diff --git a/vulnerabilitylookup/feeders/gsd.py b/vulnerabilitylookup/feeders/gsd.py index 9bd28086..2f45992b 100644 --- a/vulnerabilitylookup/feeders/gsd.py +++ b/vulnerabilitylookup/feeders/gsd.py @@ -93,9 +93,19 @@ def gsd_update(self) -> bool: last_modified = datetime.fromisoformat(vuln['gsd']['osvSchema']['modified']) if not last_modified and 'namespaces' in vuln: if 'nvd.nist.gov' in vuln['namespaces']: - last_modified = datetime.fromisoformat(vuln['namespaces']['nvd.nist.gov']['lastModifiedDate']) + try: + last_modified = datetime.fromisoformat(vuln['namespaces']['nvd.nist.gov']['lastModifiedDate']) + except ValueError as e: + # nothing important, just a broken date + self.logger.warning(f'Unable to get modified date: {e}') + needs_lastmodified_from_git = True elif 'gitlab.com' in vuln['namespaces']: - last_modified = datetime.fromisoformat(vuln['namespaces']['gitlab.com']['advisories'][0]['date']) + try: + last_modified = datetime.fromisoformat(vuln['namespaces']['gitlab.com']['advisories'][0]['date']) + except ValueError as e: + # nothing important, just a broken date + self.logger.warning(f'Unable to get modified date: {e}') + needs_lastmodified_from_git = True else: if 'cve.org' in vuln['namespaces'] and vuln['namespaces']['cve.org']['CVE_data_meta']['STATE'] == 'RESERVED': # reserved ID