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.

storage: nil-safe ReplicaPlacement.String()

Chris Lu33df4fe2c40f
diff --git a/weed/storage/super_block/replica_placement.go b/weed/storage/super_block/replica_placement.go
index 1562882a6d..ec4ecf2540 100644
--- a/weed/storage/super_block/replica_placement.go
+++ b/weed/storage/super_block/replica_placement.go
@@ -69,6 +69,9 @@ func (rp *ReplicaPlacement) Byte() byte {
}
func (rp *ReplicaPlacement) String() string {
+ if rp == nil {
+ return ""
+ }
b := make([]byte, 3)
b[0] = byte(rp.DiffDataCenterCount + '0')
b[1] = byte(rp.DiffRackCount + '0')