From 06bd3b90379c7387ed7e33bfbb5f4f5ff4373a01 Mon Sep 17 00:00:00 2001 From: Chotiwat Chawannakul Date: Tue, 20 Aug 2013 12:06:45 +0700 Subject: [PATCH] Connection: fix getQuotaRoot crashes when box has no quota root --- lib/Connection.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/Connection.js b/lib/Connection.js index 664ee6a..778f655 100644 --- a/lib/Connection.js +++ b/lib/Connection.js @@ -903,8 +903,10 @@ Connection.prototype.getQuotaRoot = function(boxName, cb) { return cb(err); var quotas = {}; - for (var i = 0, len = quotalist.length; i < len; ++i) - quotas[quotalist[i].root] = quotalist[i].resources; + if (quotalist) { + for (var i = 0, len = quotalist.length; i < len; ++i) + quotas[quotalist[i].root] = quotalist[i].resources; + } cb(err, quotas); });