Merge pull request #345 from future-architect/avoid-null

Avoid null slice being null in JSON
This commit is contained in:
Kota Kanbe
2017-02-19 09:37:36 +09:00
committed by GitHub
4 changed files with 38 additions and 6 deletions

View File

@@ -202,10 +202,12 @@ func scanVulnByCpeNames(cpeNames []string, scannedVulns []models.VulnInfo) ([]mo
val.CpeNames = names
set[detail.CveID] = val
} else {
set[detail.CveID] = models.VulnInfo{
v := models.VulnInfo{
CveID: detail.CveID,
CpeNames: []string{name},
}
v.NilSliceToEmpty()
set[detail.CveID] = v
}
}
}