Convert null to empty in JSON

This commit is contained in:
Kota Kanbe
2017-06-03 14:44:04 +09:00
committed by kota kanbe
parent a7951b727c
commit e9df2bfa01
2 changed files with 27 additions and 17 deletions

View File

@@ -104,6 +104,11 @@ func fillCveInfo(r *models.ScanResult) error {
if err := fillCveInfoFromCveDB(r); err != nil {
return fmt.Errorf("Failed to fill CVE information: %s", err)
}
for cveID := range r.ScannedCves {
vinfo := r.ScannedCves[cveID]
r.ScannedCves[cveID] = *vinfo.NilToEmpty()
}
return nil
}
@@ -192,8 +197,6 @@ func fillVulnByCpeNames(cpeNames []string, scannedVulns models.VulnInfos) error
CpeNames: []string{name},
Confidence: models.CpeNameMatch,
}
//TODO
// v.NilToEmpty()
scannedVulns[detail.CveID] = v
}
}