Skip to content

Commit

Permalink
Add NPE check
Browse files Browse the repository at this point in the history
  • Loading branch information
EyalDelarea committed Sep 26, 2023
1 parent cb1bc55 commit 16f09b7
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions xray/utils/resultstable.go
Original file line number Diff line number Diff line change
Expand Up @@ -1025,14 +1025,16 @@ func printApplicabilityCveValue(applicabilityStatus ApplicabilityStatus, isTable
// filePath = myProject/node_modules/mpath/badCode.js , disqualify = False.
// Found use of a badCode inside the node_modules from a different package, report applicable.
func shouldDisqualifyEvidence(components map[string]services.Component, evidenceFilePath *sarif.Location) (disqualify bool) {
// TODO npe check here
fullPath := *evidenceFilePath.PhysicalLocation.ArtifactLocation.URI
fullPath := evidenceFilePath.PhysicalLocation.ArtifactLocation.URI
if fullPath == nil {
return
}
for key := range components {
dependencyName, envLocationPath, supported := parseComponent(key)
if !supported {
continue
}
if disqualify = checkIfSelfNested(fullPath, dependencyName, envLocationPath); disqualify {
if disqualify = checkIfSelfNested(*fullPath, dependencyName, envLocationPath); disqualify {
return
}
}
Expand Down

0 comments on commit 16f09b7

Please sign in to comment.