bug: panic on nil pointer dereference for "mc admin heal" when disk i… (#4571)

This commit is contained in:
Thierry FOURNIER
2023-05-17 10:03:17 -07:00
committed by GitHub
parent aefb1db4db
commit c767a3705f
+1 -1
View File
@@ -380,7 +380,7 @@ func (s verboseBackgroundHealStatusMessage) String() string {
stateText = console.Colorize("DiskFailed", d.State)
}
fmt.Fprintf(&msg, " + %s : %s\n", d.DrivePath, stateText)
if d.Healing {
if d.Healing && d.HealInfo != nil {
now := time.Now().UTC()
scanSpeed := float64(d.UsedSpace) / float64(now.Sub(d.HealInfo.Started))
remainingTime := time.Duration(float64(setsStatus[setIndex{d.PoolIndex, d.SetIndex}].maxUsedSpace-d.UsedSpace) / scanSpeed)