From f7c27b9af9823baad0c2bb34d036d8991ac587e6 Mon Sep 17 00:00:00 2001 From: Robert Griesemer Date: Thu, 11 Mar 2010 17:39:55 -0800 Subject: [PATCH] ast/filter.go: missing nil-check causes crash R=rsc CC=golang-dev https://golang.org/cl/461041 --- src/pkg/go/ast/filter.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pkg/go/ast/filter.go b/src/pkg/go/ast/filter.go index 1c2aea3574..4e2060303b 100644 --- a/src/pkg/go/ast/filter.go +++ b/src/pkg/go/ast/filter.go @@ -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