diff --git a/pkg/policies/scorecard/scorecard.go b/pkg/policies/scorecard/scorecard.go index b401af57..66f68bd6 100644 --- a/pkg/policies/scorecard/scorecard.go +++ b/pkg/policies/scorecard/scorecard.go @@ -238,7 +238,7 @@ func convertLogs(logs []checker.CheckDetail) []string { var s []string for _, l := range logs { if l.Msg.Finding != nil { - if l.Msg.Finding.Location == nil { + if l.Msg.Finding.Location == nil || l.Msg.Finding.Location.Snippet == nil || l.Msg.Finding.Location.LineStart == nil { s = append(s, fmt.Sprintf("%v", l.Msg.Finding.Message)) } else { s = append(s, fmt.Sprintf("%v[%v]:%v", *l.Msg.Finding.Location.Snippet, *l.Msg.Finding.Location.LineStart, l.Msg.Finding.Message))