Skip to content

Commit 2aaa9c4

Browse files
committed
Comment the reason why the file can be nil when an issue is created
Change-Id: I85295a33f540255f4904e663144b959877d0c38a Signed-off-by: Cosmin Cojocar <ccojocar@google.com>
1 parent 700e9a9 commit 2aaa9c4

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

analyzers/util.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ func newIssue(analyzerID string, desc string, fileSet *token.FileSet,
6262
pos token.Pos, severity, confidence issue.Score,
6363
) *issue.Issue {
6464
file := fileSet.File(pos)
65+
// This can occur when there is a compilation issue into the code.
6566
if file == nil {
6667
return &issue.Issue{}
6768
}

0 commit comments

Comments
 (0)