From 074dc71087bd4569743175b2e34ea1a160e3f024 Mon Sep 17 00:00:00 2001 From: Cosmin Cojocar Date: Sat, 20 Aug 2022 12:50:34 +0200 Subject: [PATCH] fix: handle nil CWE pointer in text template --- report/text/template.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/report/text/template.txt b/report/text/template.txt index 68f2632..d084be8 100644 --- a/report/text/template.txt +++ b/report/text/template.txt @@ -6,7 +6,7 @@ Golang errors in file: [{{ $filePath }}]: {{end}} {{end}} {{ range $index, $issue := .Issues }} -[{{ highlight $issue.FileLocation $issue.Severity $issue.NoSec }}] - {{ $issue.RuleID }}{{ if $issue.NoSec }} ({{- success "NoSec" -}}){{ end }} ({{ $issue.Cwe.SprintID }}): {{ $issue.What }} (Confidence: {{ $issue.Confidence}}, Severity: {{ $issue.Severity }}) +[{{ highlight $issue.FileLocation $issue.Severity $issue.NoSec }}] - {{ $issue.RuleID }}{{ if $issue.NoSec }} ({{- success "NoSec" -}}){{ end }} ({{ if $issue.Cwe }} {{ $issue.Cwe.SprintID }} {{ else }} "CWE" {{ end }}): {{ $issue.What }} (Confidence: {{ $issue.Confidence}}, Severity: {{ $issue.Severity }}) {{ printCode $issue }} {{ end }}