mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
return nil instead of memory access error
This commit is contained in:
parent
6658d5de45
commit
1aea3512a4
|
@ -43,7 +43,10 @@ func (vl *VolumeLayout) isWritable(v *storage.VolumeInfo) bool {
|
|||
}
|
||||
|
||||
func (vl *VolumeLayout) Lookup(vid storage.VolumeId) []*DataNode {
|
||||
return vl.vid2location[vid].list
|
||||
if location := vl.vid2location[vid]; location != nil {
|
||||
return location.list
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (vl *VolumeLayout) PickForWrite(count int) (*storage.VolumeId, int, *VolumeLocationList, error) {
|
||||
|
|
Loading…
Reference in a new issue