Fix crash when no mailbox usage present

This commit is contained in:
Girish Ramakrishnan
2020-02-27 10:10:57 -08:00
parent 60f42e342b
commit dfe2eee0b9

View File

@@ -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();
});