Browse Source

Fix panic error when target collection is not exist.

Fix: interface conversion: interface {} is nil, not *topology.Collection.
pull/533/head
Xinran Xu 8 years ago
committed by GitHub
parent
commit
4a0939a4e4
  1. 3
      weed/topology/topology.go

3
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
}

Loading…
Cancel
Save