mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
Fix panic error when target collection is not exist.
Fix: interface conversion: interface {} is nil, not *topology.Collection.
This commit is contained in:
parent
f9a1769df1
commit
4a0939a4e4
|
@ -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…
Reference in a new issue