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 <rstambler@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
diff --git a/internal/lsp/source/identifier.go b/internal/lsp/source/identifier.go
index d4f9591..f892780 100644
--- a/internal/lsp/source/identifier.go
+++ b/internal/lsp/source/identifier.go
@@ -248,6 +248,9 @@
 						}
 					}
 				}
+				if exported == nil {
+					return nil
+				}
 				return exported
 			}
 		case *ast.CompositeLit: