mirror of https://github.com/golang/go.git
internal/lsp: add check for nil results to fillreturns
Avoid panicking when allocating an array for a nil results list by returning early. Change-Id: I26953b5cef7832bad3006bd316d59978a5d94cbd Reviewed-on: https://go-review.googlesource.com/c/tools/+/418416 Run-TryBot: Suzy Mueller <suzmue@golang.org> Reviewed-by: Robert Findley <rfindley@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> gopls-CI: kokoro <noreply+kokoro@google.com>
This commit is contained in:
parent
79f3242e4b
commit
ec1f92440b
|
|
@ -113,7 +113,7 @@ outer:
|
|||
break
|
||||
}
|
||||
}
|
||||
if enclosingFunc == nil {
|
||||
if enclosingFunc == nil || enclosingFunc.Results == nil {
|
||||
continue
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue