Skip to content

Commit

Permalink
Fix some bugs in latest PR
Browse files Browse the repository at this point in the history
  • Loading branch information
attiasas committed Jun 6, 2024
1 parent 734d530 commit 843ee4e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
6 changes: 3 additions & 3 deletions commands/scan/dockerscan.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,12 @@ func (dsc *DockerScanCommand) Run() (err error) {
}
}()
return dsc.ScanCommand.RunAndRecordResults(func(scanResults *utils.Results) (err error) {
if scanResults == nil {
if scanResults == nil || len(scanResults.ScaResults) == 0 {
return
}
for _, scaResult := range scanResults.ScaResults {
for i := range scanResults.ScaResults {
// Set the image tag as the target for the scan results (will show `image.tar` as target if not set)
scaResult.Target = dsc.imageTag
scanResults.ScaResults[i].Target = dsc.imageTag
}
return utils.RecordSecurityCommandOutput(utils.ScanCommandSummaryResult{Results: scanResults.GetSummary(), Section: utils.Binary})
})
Expand Down
1 change: 0 additions & 1 deletion commands/scan/scan.go
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,6 @@ func (scanCmd *ScanCommand) createIndexerHandlerFunc(file *spec.File, entitledFo
if err != nil {
log.Error(fmt.Sprintf("scanning '%s' failed with error: %s", graph.Id, err.Error()))
indexedFileErrors[threadId] = append(indexedFileErrors[threadId], formats.SimpleJsonError{FilePath: filePath, ErrorMessage: err.Error()})
return
}
}
resultsArr[threadId] = append(resultsArr[threadId], &ScanInfo{Target: filePath, Result: scanResults, ExtendedScanResults: &extendedScanResults})
Expand Down

0 comments on commit 843ee4e

Please sign in to comment.