Skip to content

Commit b47602a

Browse files
committed
internal/lsp: handle nil pointer in go.mod links
Fixes #40433 Change-Id: I9e85f6d28886f8addf1d9142bc87f22eee1a4a36 Reviewed-on: https://go-review.googlesource.com/c/tools/+/244840 Run-TryBot: Rebecca Stambler <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Heschi Kreinick <[email protected]>
1 parent 1c30660 commit b47602a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

internal/lsp/link.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ func modLinks(ctx context.Context, snapshot source.Snapshot, fh source.FileHandl
5656
}
5757
var links []protocol.DocumentLink
5858
for _, req := range file.Require {
59+
if req.Syntax == nil {
60+
continue
61+
}
5962
// See golang/go#36998: don't link to modules matching GOPRIVATE.
6063
if snapshot.View().IsGoPrivatePath(req.Mod.Path) {
6164
continue

0 commit comments

Comments
 (0)