XL/ListVols: Fix panic. Skip if slice is nil. (#1694)

Fixes #1692
This commit is contained in:
Krishna Srinivas 2016-05-20 00:02:19 +05:30 committed by Harshavardhana
parent 62b4fd6964
commit 537568f9f9

View File

@ -264,6 +264,9 @@ func (xl XL) ListVols() (volsInfo []VolInfo, err error) {
var total, free int64 var total, free int64
// Loop through success vols and get aggregated usage values. // Loop through success vols and get aggregated usage values.
for _, vlsInfo := range successVols { for _, vlsInfo := range successVols {
if len(vlsInfo) == 0 {
continue
}
free += vlsInfo[0].Free free += vlsInfo[0].Free
total += vlsInfo[0].Total total += vlsInfo[0].Total
} }