Skip to content

Commit bbc4b4b

Browse files
committed
Fix panic when no graph results exists at scan cmd
1 parent 06342f4 commit bbc4b4b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

commands/scan/scan.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -579,6 +579,10 @@ func (scanCmd *ScanCommand) RunBinaryJasScans(cmdType utils.CommandType, msi str
579579
Module: module,
580580
ScansToPerform: scanCmd.scansToPerform,
581581
CvesProvider: func() (directCves []string, indirectCves []string) {
582+
if graphScanResults == nil {
583+
// No SCA scan results, return empty CVE lists.
584+
return
585+
}
582586
return results.ExtractCvesFromScanResponse([]services.ScanResponse{*graphScanResults}, *directDepsListFromVulnerabilities(graphScanResults))
583587
},
584588
ScanResults: targetResults,

0 commit comments

Comments
 (0)