mirror of https://github.com/golang/go.git
internal/lsp: handle potential nil pointer
Change-Id: I345b0d22053248f875683d87515d9e7c5e1d16c6 Reviewed-on: https://go-review.googlesource.com/c/tools/+/195518 Reviewed-by: Ian Cottrell <iancottrell@google.com> Run-TryBot: Rebecca Stambler <rstambler@golang.org>
This commit is contained in:
parent
1ccc110ba9
commit
92af9d69ef
|
|
@ -123,6 +123,9 @@ func pkgToMapper(ctx context.Context, view View, pkg Package, uri span.URI) (*as
|
|||
ph = h
|
||||
}
|
||||
}
|
||||
if ph == nil {
|
||||
return nil, nil, errors.Errorf("no ParseGoHandle for %s", uri)
|
||||
}
|
||||
file, err := ph.Cached(ctx)
|
||||
if file == nil {
|
||||
return nil, nil, err
|
||||
|
|
|
|||
Loading…
Reference in New Issue