Skip to content

Commit df70183

Browse files
committed
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]>
1 parent e8769cc commit df70183

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
@@ -248,6 +248,9 @@ func searchForEnclosing(info *types.Info, path []ast.Node) types.Type {
248248
}
249249
}
250250
}
251+
if exported == nil {
252+
return nil
253+
}
251254
return exported
252255
}
253256
case *ast.CompositeLit:

0 commit comments

Comments
 (0)