admin: HealObjectInfo can be nil skip it. (#2059)

Fixes #2058
This commit is contained in:
Harshavardhana
2017-03-03 20:37:04 -08:00
committed by GitHub
parent bf657a33e3
commit 99682ecbdb
2 changed files with 8 additions and 0 deletions
+4
View File
@@ -205,6 +205,10 @@ func mainAdminHealList(ctx *cli.Context) error {
errorIf(probe.NewError(obj.Err), "Cannot heal object `"+obj.Key+"`.")
continue
}
// Skip for non-recursive use case.
if obj.HealObjectInfo == nil {
continue
}
printMsg(healListMessage{Bucket: currBucket, Object: obj})
}
}
+4
View File
@@ -159,6 +159,10 @@ func mainAdminHeal(ctx *cli.Context) error {
errorIf(probe.NewError(obj.Err), "Cannot list objects to be healed.")
continue
}
// Heal object info is nil skip it, must be a directory.
if obj.HealObjectInfo == nil {
continue
}
// Check the heal status, and call heal object API only when an object can be healed
switch healInfo := *obj.HealObjectInfo; healInfo.Status {