Fix crash when no mailbox usage present
This commit is contained in:
@@ -394,7 +394,10 @@ angular.module('Application').controller('EmailController', ['$scope', '$locatio
|
||||
Client.getMailUsage($scope.domain.domain, function (error, usage) {
|
||||
if (error) return callback(error);
|
||||
|
||||
$scope.mailboxes.mailboxes.forEach(function (m) { m.usage = usage[m.name + '@' + m.domain].size || 0; });
|
||||
$scope.mailboxes.mailboxes.forEach(function (m) {
|
||||
var u = usage[m.name + '@' + m.domain]; // this is unset when no emails have been received yet
|
||||
m.usage = (u && u.size) || 0;
|
||||
});
|
||||
|
||||
callback();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user