1
0
mirror of https://github.com/golang/go synced 2024-11-18 14:14:46 -07:00

go.tools/dashboard: don't do method calls or field lookups on a possibly nil repo

LGTM=mischief, adg
R=adg, mischief
CC=golang-codereviews
https://golang.org/cl/106660043
This commit is contained in:
Chris Manghane 2014-07-23 10:22:29 -07:00
parent b5528ca070
commit 129869a1a6

View File

@ -623,12 +623,14 @@ func commitPoll(repo *Repo, pkg, key string) {
repo, err = RemoteRepo(pkg, pkgPath)
if err != nil {
log.Printf("Error cloning package (%s): %s", pkg, err)
return
}
repo, err = repo.Clone(repo.Path, "tip")
path := repo.Path
repo, err = repo.Clone(path, "tip")
if err != nil {
log.Printf("%s: hg clone failed: %v", pkg, err)
if err := os.RemoveAll(repo.Path); err != nil {
if err := os.RemoveAll(path); err != nil {
log.Printf("%s: %v", pkg, err)
}
}