mirror of
https://github.com/golang/go
synced 2024-11-20 06:54:42 -07:00
ast/filter.go: missing nil-check causes crash
R=rsc CC=golang-dev https://golang.org/cl/461041
This commit is contained in:
parent
3e24f2d6df
commit
f7c27b9af9
@ -293,7 +293,7 @@ func MergePackageFiles(pkg *Package, complete bool) *File {
|
||||
name := f.Name.Name()
|
||||
if j, exists := funcs[name]; exists {
|
||||
// function declared already
|
||||
if decls[j].(*FuncDecl).Doc == nil {
|
||||
if decls[j] != nil && decls[j].(*FuncDecl).Doc == nil {
|
||||
// existing declaration has no documentation;
|
||||
// ignore the existing declaration
|
||||
decls[j] = nil
|
||||
|
Loading…
Reference in New Issue
Block a user