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>
diff --git a/internal/lsp/analysis/fillreturns/fillreturns.go b/internal/lsp/analysis/fillreturns/fillreturns.go
index 4a30934..705ae12 100644
--- a/internal/lsp/analysis/fillreturns/fillreturns.go
+++ b/internal/lsp/analysis/fillreturns/fillreturns.go
@@ -113,7 +113,7 @@
 				break
 			}
 		}
-		if enclosingFunc == nil {
+		if enclosingFunc == nil || enclosingFunc.Results == nil {
 			continue
 		}