Skip to content

Commit 8d204f8

Browse files
committed
[gopls-release-branch.0.4] internal/lsp/source: add extra nil check in searchForEnclosing
I still keep seeing this crash too, even after CL 244841. Fixes golang/go#40464 Change-Id: Ic587045e65f34c24bd6df452e24517fd90e36bbe Reviewed-on: https://go-review.googlesource.com/c/tools/+/245440 Run-TryBot: Rebecca Stambler <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Robert Findley <[email protected]> (cherry picked from commit df70183) Reviewed-on: https://go-review.googlesource.com/c/tools/+/245457
1 parent 4d6b19c commit 8d204f8

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

internal/lsp/source/identifier.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,9 @@ func searchForEnclosing(info *types.Info, path []ast.Node) types.Type {
256256
}
257257
}
258258
}
259+
if exported == nil {
260+
return nil
261+
}
259262
return exported
260263
}
261264
case *ast.CompositeLit:

0 commit comments

Comments
 (0)