Skip to content

Commit

Permalink
using utils.OrDefault to avoid nilpointer
Browse files Browse the repository at this point in the history
  • Loading branch information
timbastin committed Feb 24, 2025
1 parent 33b4975 commit e909028
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/devguard-scanner/commands/sca.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ func printScaResults(scanResponse scan.ScanResponse, failOnRisk, assetName, webU

// order the flaws by their risk
slices.SortFunc(scanResponse.Flaws, func(a, b flaw.FlawDTO) int {
return int(*(a.RawRiskAssessment)*100) - int(*b.RawRiskAssessment*100)
return int(utils.OrDefault(a.RawRiskAssessment, 0)*100) - int(utils.OrDefault(b.RawRiskAssessment, 0)*100)
})

// get the max risk of open!!! flaws
Expand Down

0 comments on commit e909028

Please sign in to comment.