diff --git a/earthaccess/search.py b/earthaccess/search.py index f2913b23..3a2b458d 100644 --- a/earthaccess/search.py +++ b/earthaccess/search.py @@ -468,7 +468,7 @@ def get(self, limit: int = 2000) -> List[DataGranule]: RuntimeError: The CMR query failed. """ response = get_results(self.session, self, limit) - cloud = response and self._is_cloud_hosted(response[0]) + cloud = len(response) > 0 and self._is_cloud_hosted(response[0]) return [DataGranule(granule, cloud_hosted=cloud) for granule in response]