Skip to content

Commit

Permalink
fix: Check if vulnerability severity exists when calculating vulnerab…
Browse files Browse the repository at this point in the history
…ility score (#80)
  • Loading branch information
tamasmak authored and heruan committed Oct 12, 2023
1 parent f949a0d commit abb59f8
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,9 @@ private static SeverityLevel findSeverityIfHigher(

private static Double findScoreIfHigher(
OpenSourceVulnerability vulnerability, Double highestScore) {
if (vulnerability.getSeverity() == null) {
return highestScore;
}
Double hiScoreInVuln = vulnerability.getSeverity().stream()
.map(severity -> Cvss.fromVector(severity.getScore()))
.map(cvss -> cvss.calculateScore().getBaseScore())
Expand Down

0 comments on commit abb59f8

Please sign in to comment.