From 11d29971ea8a23277aff2923efd02ce91afea47b Mon Sep 17 00:00:00 2001 From: "Randall C. O'Reilly" Date: Sun, 28 Jul 2024 11:05:01 -0700 Subject: [PATCH] avoid crash in golang parsing --- parse/languages/golang/typeinfer.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/parse/languages/golang/typeinfer.go b/parse/languages/golang/typeinfer.go index e694deaccf..313831db76 100644 --- a/parse/languages/golang/typeinfer.go +++ b/parse/languages/golang/typeinfer.go @@ -111,8 +111,11 @@ func (gl *GoLang) InferSymbolType(sy *syms.Symbol, fs *parse.FileState, pkg *sym if ffc.Name == "Name" { ffc = ffc.NextAST() } - vty, ok := gl.TypeFromAST(fs, pkg, nil, ffc) - if ok { + var vty *syms.Type + if ffc != nil { + vty, _ = gl.TypeFromAST(fs, pkg, nil, ffc) + } + if vty != nil { sy.Type = SymTypeNameForPkg(vty, pkg) } else { sy.Type = TypeErr