aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lu <chrislusf@users.noreply.github.com>2017-07-14 11:42:51 -0700
committerGitHub <noreply@github.com>2017-07-14 11:42:51 -0700
commit0909f669a0f15c132c13dac42477c211fb5dfacc (patch)
tree252c184b138a5a62f238ccea4ff6b0e10fe68ff3
parentf9a1769df10dfd3f33c569af9cb27db1628e5159 (diff)
parent4a0939a4e4e089ebccf270ad6b416d6c2c100d48 (diff)
downloadseaweedfs-0909f669a0f15c132c13dac42477c211fb5dfacc.tar.xz
seaweedfs-0909f669a0f15c132c13dac42477c211fb5dfacc.zip
Merge pull request #533 from xxr3376/patch-1
Fix panic error when target collection is not exist.
-rw-r--r--weed/topology/topology.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/weed/topology/topology.go b/weed/topology/topology.go
index 1c5633e95..27d22ee7e 100644
--- a/weed/topology/topology.go
+++ b/weed/topology/topology.go
@@ -116,6 +116,9 @@ func (t *Topology) GetVolumeLayout(collectionName string, rp *storage.ReplicaPla
func (t *Topology) FindCollection(collectionName string) (*Collection, bool) {
c, hasCollection := t.collectionMap.Find(collectionName)
+ if !hasCollection {
+ return nil, false
+ }
return c.(*Collection), hasCollection
}