Skip to content

Commit fd16908

Browse files
committed
Avoid panic with scorecard logs.
Signed-off-by: Jeff Mendoza <[email protected]>
1 parent c532eed commit fd16908

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/policies/scorecard/scorecard.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ func convertLogs(logs []checker.CheckDetail) []string {
238238
var s []string
239239
for _, l := range logs {
240240
if l.Msg.Finding != nil {
241-
if l.Msg.Finding.Location == nil {
241+
if l.Msg.Finding.Location == nil || l.Msg.Finding.Location.Snippet == nil || l.Msg.Finding.Location.LineStart == nil {
242242
s = append(s, fmt.Sprintf("%v", l.Msg.Finding.Message))
243243
} else {
244244
s = append(s, fmt.Sprintf("%v[%v]:%v", *l.Msg.Finding.Location.Snippet, *l.Msg.Finding.Location.LineStart, l.Msg.Finding.Message))

0 commit comments

Comments
 (0)