From 544b4d03053537466c73e080f88760df3bdb7e33 Mon Sep 17 00:00:00 2001 From: Joseph H Kennedy Date: Fri, 4 Oct 2024 05:21:25 -0800 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Chuck Daniels --- CHANGELOG.md | 3 ++- earthaccess/search.py | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f53e94a8..bc892679 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,11 +28,12 @@ and this project uses [Semantic Versioning](https://semver.org/spec/v2.0.0.html) ### Fixed + - Integration tests no longer clobber existing `.netrc` file ([#806](https://github.com/nsidc/earthaccess/issues/806)) (@chuckwondo) - Return an empty list instead of raising an `IndexError` when searches find no results. - ([#839](https://github.com/nsidc/earthaccess/pull/839)) + ([#526](https://github.com/nsidc/earthaccess/issues/526)) ([@jhkennedy](https://github.com/jhkennedy)) ## [0.11.0] 2024-10-01 diff --git a/earthaccess/search.py b/earthaccess/search.py index f9368273..f2913b23 100644 --- a/earthaccess/search.py +++ b/earthaccess/search.py @@ -468,8 +468,7 @@ def get(self, limit: int = 2000) -> List[DataGranule]: RuntimeError: The CMR query failed. """ response = get_results(self.session, self, limit) - if response: - cloud = self._is_cloud_hosted(response[0]) + cloud = response and self._is_cloud_hosted(response[0]) return [DataGranule(granule, cloud_hosted=cloud) for granule in response]