[WO-805] Do not attempt to write to undefined when folders are not yet loaded

This commit is contained in:
Felix Hammerl 2015-01-08 13:54:30 +01:00
parent 137c6fe971
commit b0476989fb
1 changed files with 6 additions and 0 deletions

View File

@ -100,6 +100,12 @@ var NavigationCtrl = function($scope, $location, $q, account, email, outbox, not
var ob = _.findWhere($scope.account.folders, {
type: config.outboxMailboxType
});
if (!ob) {
// the outbox folder has not been initialized yet
return;
}
ob.count = count;
return $q(function(resolve) {