From 4a0939a4e4e089ebccf270ad6b416d6c2c100d48 Mon Sep 17 00:00:00 2001 From: Xinran Xu Date: Fri, 14 Jul 2017 20:04:33 +0800 Subject: [PATCH] Fix panic error when target collection is not exist. Fix: interface conversion: interface {} is nil, not *topology.Collection. --- weed/topology/topology.go | 3 +++ 1 file changed, 3 insertions(+) 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 }