internal/lsp: fix regression from CL 179439

Fixes golang/go#32378

Change-Id: I7c5b794ba6137084a56e3e7bf8027a6f65819b34
Reviewed-on: https://go-review.googlesource.com/c/tools/+/179919
Run-TryBot: Rebecca Stambler <rstambler@golang.org>
Reviewed-by: Ian Cottrell <iancottrell@google.com>
This commit is contained in:
Rebecca Stambler 2019-05-31 23:34:02 -04:00
parent 178e83bc9d
commit a4e9122f10
1 changed files with 5 additions and 1 deletions

View File

@ -161,5 +161,9 @@ func (pkg *pkg) IsIllTyped() bool {
} }
func (pkg *pkg) GetImport(pkgPath string) source.Package { func (pkg *pkg) GetImport(pkgPath string) source.Package {
return pkg.imports[pkgPath] if imp := pkg.imports[pkgPath]; imp != nil {
return imp
}
// Don't return a nil pointer because that still satisfies the interface.
return nil
} }