From 0d90f1ea2d823154ef4fca354b615d5cecff769c Mon Sep 17 00:00:00 2001 From: kunlongli Date: Thu, 13 Jul 2023 11:53:35 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8DSecurityResult?= =?UTF-8?q?=E9=83=A8=E5=88=86=E5=AD=97=E6=AE=B5=E8=A2=AB=E5=BA=8F=E5=88=97?= =?UTF-8?q?=E5=8C=96=E4=B8=BAnull=E5=AF=BC=E8=87=B4=E4=B8=8A=E6=8A=A5?= =?UTF-8?q?=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- standard-adapter/pkg/adapter.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/standard-adapter/pkg/adapter.go b/standard-adapter/pkg/adapter.go index 2005f8c..aec055b 100644 --- a/standard-adapter/pkg/adapter.go +++ b/standard-adapter/pkg/adapter.go @@ -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 }