internal/lsp: handle nil pointer in (*Package).GetActionGraph
Fixes golang/go#31700 Change-Id: I1ee71f65d2bdb2a95b261c4266df64b473d2fda5 Reviewed-on: https://go-review.googlesource.com/c/tools/+/174019 Run-TryBot: Rebecca Stambler <rstambler@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Cottrell <iancottrell@google.com>
This commit is contained in:
parent
7af746645d
commit
f97eea45a1
|
@ -108,7 +108,10 @@ func (pkg *Package) GetActionGraph(ctx context.Context, a *analysis.Analyzer) (*
|
|||
}
|
||||
sort.Strings(importPaths) // for determinism
|
||||
for _, importPath := range importPaths {
|
||||
dep := pkg.imports[importPath]
|
||||
dep, ok := pkg.imports[importPath]
|
||||
if !ok {
|
||||
continue
|
||||
}
|
||||
act, err := dep.GetActionGraph(ctx, a)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
@ -116,7 +119,6 @@ func (pkg *Package) GetActionGraph(ctx context.Context, a *analysis.Analyzer) (*
|
|||
e.Deps = append(e.Deps, act)
|
||||
}
|
||||
}
|
||||
|
||||
e.succeeded = true
|
||||
}
|
||||
return e.Action, nil
|
||||
|
|
Loading…
Reference in New Issue