Skip to content

Commit eb6fa9f

Browse files
fix potential nil pointer exception
Signed-off-by: denis-tingajkin <denis.tingajkin@xored.com>
1 parent fbce520 commit eb6fa9f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pkg/golinters/goheader.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ func NewGoHeader() *goanalysis.Linter {
5151
var res []goanalysis.Issue
5252
for _, file := range pass.Files {
5353
i := a.Analyze(file)
54+
if i == nil {
55+
continue
56+
}
5457
issue := result.Issue{
5558
Pos: token.Position{
5659
Line: i.Location().Line + 1,

0 commit comments

Comments
 (0)