From 537568f9f986f948a7a15d7b552b0875ba880fb8 Mon Sep 17 00:00:00 2001 From: Krishna Srinivas Date: Fri, 20 May 2016 00:02:19 +0530 Subject: [PATCH] XL/ListVols: Fix panic. Skip if slice is nil. (#1694) Fixes #1692 --- xl-erasure-v1.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/xl-erasure-v1.go b/xl-erasure-v1.go index 88b4c5b08..f1fae87d1 100644 --- a/xl-erasure-v1.go +++ b/xl-erasure-v1.go @@ -264,6 +264,9 @@ func (xl XL) ListVols() (volsInfo []VolInfo, err error) { var total, free int64 // Loop through success vols and get aggregated usage values. for _, vlsInfo := range successVols { + if len(vlsInfo) == 0 { + continue + } free += vlsInfo[0].Free total += vlsInfo[0].Total }