Skip to content

Commit

Permalink
Merge pull request #15 from jc0b/dev
Browse files Browse the repository at this point in the history
Fixed a bug where an empty CVE dataset could be returned
  • Loading branch information
jc0b authored Nov 8, 2024
2 parents ff690a5 + f097415 commit 1295e67
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion nudge-auto-updater.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,9 @@ def get_CVE_scores(s:str, b:bool, api_key):
except Exception as e:
logging.error(f"Unable to load CVE data for {s}.")
sys.exit(1)
if "cvssMetricV31" in result["data"][0]["metrics"]:
if result["_meta"]["total_documents"] < 1:
return None
elif "cvssMetricV31" in result["data"][0]["metrics"]:
return read_CVE_scores(result["data"][0]["metrics"]["cvssMetricV31"][0], b)
else:
return None
Expand Down

0 comments on commit 1295e67

Please sign in to comment.