mirror of
https://github.com/golang/go
synced 2024-11-18 16:04:44 -07:00
internal/lsp/cache: fix nil check by adding missing "continue"
Without this accessing gof.ast.file.Pos() will panic if gof.ast.file is nil Change-Id: I829f3667d201f026fcf0475f4fdabce0aced58f8 Change-Id: I829f3667d201f026fcf0475f4fdabce0aced58f8 GitHub-Last-Rev: 777c015d691bf0d14cab5bb0bca6749cc9bdf605 GitHub-Pull-Request: golang/tools#119 Reviewed-on: https://go-review.googlesource.com/c/tools/+/182420 Reviewed-by: Ian Cottrell <iancottrell@google.com> Reviewed-by: Rebecca Stambler <rstambler@golang.org>
This commit is contained in:
parent
9a3b5d688f
commit
6f0482744c
1
internal/lsp/cache/check.go
vendored
1
internal/lsp/cache/check.go
vendored
@ -178,6 +178,7 @@ func (imp *importer) cachePackage(ctx context.Context, pkg *pkg, meta *metadata)
|
||||
}
|
||||
if gof.ast.file == nil {
|
||||
imp.view.session.log.Errorf(ctx, "no AST for %s", filename)
|
||||
continue
|
||||
}
|
||||
pos := gof.ast.file.Pos()
|
||||
if !pos.IsValid() {
|
||||
|
Loading…
Reference in New Issue
Block a user