aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXinran Xu <xxr3376@gmail.com>2017-07-14 20:04:33 +0800
committerGitHub <noreply@github.com>2017-07-14 20:04:33 +0800
commit4a0939a4e4e089ebccf270ad6b416d6c2c100d48 (patch)
tree252c184b138a5a62f238ccea4ff6b0e10fe68ff3
parentf9a1769df10dfd3f33c569af9cb27db1628e5159 (diff)
downloadseaweedfs-4a0939a4e4e089ebccf270ad6b416d6c2c100d48.tar.xz
seaweedfs-4a0939a4e4e089ebccf270ad6b416d6c2c100d48.zip
Fix panic error when target collection is not exist.
Fix: interface conversion: interface {} is nil, not *topology.Collection.
-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
}