Skip to content

Commit

Permalink
fix: 修复SecurityResult部分字段被序列化为null导致上报错误
Browse files Browse the repository at this point in the history
  • Loading branch information
cnlkl committed Jul 13, 2023
1 parent f4d847e commit 0d90f1e
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions standard-adapter/pkg/adapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,5 +81,15 @@ func (e StandardAdapterExecutor) readToolOutput(f string) (*object.ToolOutput, e
if err != nil {
return nil, err
}

for i := range output.Result.SecurityResults {
r := output.Result.SecurityResults[i]
if r.PkgVersions == nil {
r.PkgVersions = []string{}
}
if r.References == nil {
r.References = []string{}
}
}
return output, nil
}

0 comments on commit 0d90f1e

Please sign in to comment.