storage: nil-safe ReplicaPlacement.String()

Guard a nil receiver like TTL.String() already does, so formatting a
zero-value VolumeInfo can't depend on fmt's panic recovery.
This commit is contained in:
Chris Lu
2026-06-16 10:42:43 -07:00
parent 9c10d64ae9
commit 33df4fe2c4
@@ -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')