fix(vulnerability): make an empty severity UNKNOWN (#759)

This commit is contained in:
Teppei Fukuda
2020-12-02 14:24:02 +09:00
committed by GitHub
parent 1bee83ccc4
commit d85cb77123
2 changed files with 38 additions and 0 deletions

View File

@@ -106,6 +106,11 @@ func (c Client) getVendorSeverity(vuln *types.DetectedVulnerability, source stri
if vs, ok := vuln.VendorSeverity[vulnerability.Nvd]; ok {
return vs.String(), vulnerability.Nvd
}
if vuln.Severity == "" {
return dbTypes.SeverityUnknown.String(), ""
}
return vuln.Severity, ""
}