Skip to content

SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.

return nil instead of memory access error

Chris Lu1aea3512a4af
diff --git a/go/topology/volume_layout.go b/go/topology/volume_layout.go
index f5c2e23608..0791bed20a 100644
--- a/go/topology/volume_layout.go
+++ b/go/topology/volume_layout.go
@@ -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) {