mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-10-21 08:18:52 +08:00
fix possible nil
This commit is contained in:
@@ -69,6 +69,9 @@ func (t *TTL) ToBytes(output []byte) {
|
||||
}
|
||||
|
||||
func (t *TTL) ToUint32() (output uint32) {
|
||||
if t == nil || t.Count == 0 {
|
||||
return 0
|
||||
}
|
||||
output = uint32(t.Count) << 8
|
||||
output += uint32(t.Unit)
|
||||
return output
|
||||
|
Reference in New Issue
Block a user