Skip to content

Commit

Permalink
Add fix
Browse files Browse the repository at this point in the history
  • Loading branch information
margaritalm committed May 15, 2024
1 parent 3dd766f commit 9f0a36a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions internal/commands/result.go
Original file line number Diff line number Diff line change
Expand Up @@ -1538,9 +1538,9 @@ func parseGlDependencyLocation(result *wrappers.ScanResult) string {
return (location)
}
func parseGlDependencyFiles(result *wrappers.ScanResult, glDependencyResult *wrappers.GlDependencyResultsCollection) *wrappers.GlDependencyResultsCollection {
if result.ScanResultData.ScaPackageCollection != nil {
if result.ScanResultData.ScaPackageCollection != nil && result.ScanResultData.ScaPackageCollection.Locations[0] != nil {
glDependencyResult.DependencyFiles = append(glDependencyResult.DependencyFiles, wrappers.DependencyFile{
Path: result.ScanResultData.ScaPackageCollection.BestPackageLink,
Path: *result.ScanResultData.ScaPackageCollection.Locations[0],
PackageManager: result.ScanResultData.ScaPackageCollection.ID,
Dependencies: collectDependencyFileLocations(result),
})
Expand Down
2 changes: 1 addition & 1 deletion internal/wrappers/results-gl-dependency.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ type DependencyLocation struct {
Package PackageName `json:"package"`
DependencyLocationVersion string `json:"version"`
Direct bool `json:"direct"`
DependencyPath uint `json:"iid"`
DependencyPath uint `json:"iid,omitempty"`
}

type PackageName struct {
Expand Down

0 comments on commit 9f0a36a

Please sign in to comment.