mirror of https://github.com/golang/go.git
internal/lsp: handle nil pointer exceptions in check for Go files
Fixes golang/go#42240 Change-Id: I48382613c9eb9d021a9e1dc9ca6ab6b4b1dfcf8f Reviewed-on: https://go-review.googlesource.com/c/tools/+/265763 Trust: Rebecca Stambler <rstambler@golang.org> Run-TryBot: Rebecca Stambler <rstambler@golang.org> gopls-CI: kokoro <noreply+kokoro@google.com> Reviewed-by: Robert Findley <rfindley@google.com> TryBot-Result: Go Bot <gobot@golang.org>
This commit is contained in:
parent
0b86805daf
commit
8cd080b735
|
|
@ -460,6 +460,9 @@ func (s *Server) handleFatalErrors(ctx context.Context, snapshot source.Snapshot
|
|||
// If the folder has no Go code in it, we shouldn't spam the user with a warning.
|
||||
var hasGo bool
|
||||
_ = filepath.Walk(snapshot.View().Folder().Filename(), func(path string, info os.FileInfo, err error) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if !strings.HasSuffix(info.Name(), ".go") {
|
||||
return nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue