Skip to content

Commit

Permalink
fixed nil pointer in curation
Browse files Browse the repository at this point in the history
  • Loading branch information
eranturgeman committed Oct 31, 2023
1 parent 7e9270a commit e40d0f5
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions xray/commands/audit/sca/npm/npm.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,15 @@ func configNpmResolutionServerIfNeeded(params utils.AuditParams) (restoreNpmrcFu
err = fmt.Errorf("got empty params upon configuring resolution server")
return
}
if params.DepsRepo() == "" {
return
}
serverDetails, err := params.ServerDetails()
if err != nil {
if err != nil || serverDetails == nil {
return
}
depsRepo := params.DepsRepo()
if depsRepo == "" {
return
}

npmCmd := npm.NewNpmCommand("install", false).SetServerDetails(serverDetails)
if err = npmCmd.PreparePrerequisites(depsRepo); err != nil {
return
Expand Down

0 comments on commit e40d0f5

Please sign in to comment.