Skip to content

Commit

Permalink
Handle cvss3 score being None it utils too
Browse files Browse the repository at this point in the history
  • Loading branch information
cb22 committed Oct 5, 2022
1 parent 5717d5a commit 1172ea6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion safety/alerts/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def highest_base_score(vulns):
highest_base_score = 0
for vuln in vulns:
if vuln['severity'] is not None:
highest_base_score = max(highest_base_score, vuln['severity'].get('cvssv3', {}).get('base_score', 10))
highest_base_score = max(highest_base_score, (vuln['severity'].get('cvssv3', {}) or {}).get('base_score', 10))

return highest_base_score

Expand Down

0 comments on commit 1172ea6

Please sign in to comment.