diff --git a/cfdm/data/data.py b/cfdm/data/data.py index 10de1d230a..abdccce980 100644 --- a/cfdm/data/data.py +++ b/cfdm/data/data.py @@ -850,8 +850,7 @@ def compressed_array(self): """ ca = self._get_Array(None) - - if not ca.get_compression_type(): + if ca is None or not ca.get_compression_type(): raise ValueError("not compressed: can't get compressed array") return ca.compressed_array