Skip to content

Commit

Permalink
another potential crash, not all URLs have descriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
reidsunderland committed Jun 25, 2024
1 parent 26df2f9 commit 38b0d6b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions sarracenia/flowcb/poll/nasa_cmr.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,11 +322,12 @@ def poll(self) -> list:
logger.debug(f"Other ({self.o.relatedUrl_type}) URL {url['URL']}")
# Skip this URL when other options are defined and don't match
logger.debug(f"remove {self.o.relatedUrl_descriptionContains}")
if ( (self.o.relatedUrl_descriptionContains is not None and
if ( (self.o.relatedUrl_descriptionContains is not None and 'Description' in url and
all(desc not in url['Description'] for desc in self.o.relatedUrl_descriptionContains))
or (self.o.relatedUrl_urlContains is not None and
all(url_c not in url['URL'] for url_c in self.o.relatedUrl_urlContains)) ):
logger.debug(f"Skipping {url['URL']} with Description {url['Description']}..." +
description = url['Description'] if 'Description' in url else "(Not Available)"
logger.debug(f"Skipping {url['URL']} with Description {description}..." +
" doesn't match relatedUrl_descriptionContains relatedUrl_urlContains options")
else:
data_url = url['URL']
Expand Down

0 comments on commit 38b0d6b

Please sign in to comment.