]> Cypherpunks repositories - gostls13.git/commitdiff
godoc: diagnostic for empty FS tree
authorRobert Griesemer <gri@golang.org>
Fri, 3 Feb 2012 16:33:29 +0000 (08:33 -0800)
committerRobert Griesemer <gri@golang.org>
Fri, 3 Feb 2012 16:33:29 +0000 (08:33 -0800)
R=adg
CC=golang-dev
https://golang.org/cl/5615055

src/cmd/godoc/godoc.go

index a4a0d8333c4a74c3b3ecea3fed8de497abfdd6cb..34e058ab5c106744ad87c4817af1daed3f7e72a2 100644 (file)
@@ -114,7 +114,12 @@ func registerPublicHandlers(mux *http.ServeMux) {
 }
 
 func initFSTree() {
-       fsTree.set(newDirectory(filepath.Join(*goroot, *testDir), nil, -1))
+       dir := newDirectory(filepath.Join(*goroot, *testDir), nil, -1)
+       if dir == nil {
+               log.Println("Warning: FSTree is nil")
+               return
+       }
+       fsTree.set(dir)
        invalidateIndex()
 }