Skip to content

Commit

Permalink
fix: handle nil CWE pointer in text template
Browse files Browse the repository at this point in the history
  • Loading branch information
ccojocar committed Aug 20, 2022
1 parent 79a5b13 commit 074dc71
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion report/text/template.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down

0 comments on commit 074dc71

Please sign in to comment.