From eabdeaf888bb002e1eed60cf30dbb561e93761f1 Mon Sep 17 00:00:00 2001 From: Felix Hammerl Date: Tue, 18 Nov 2014 16:33:09 +0100 Subject: [PATCH] Fix corner case where email does not have modseq attribute --- src/js/dao/email-dao.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/js/dao/email-dao.js b/src/js/dao/email-dao.js index 8748e85..6ba54a2 100644 --- a/src/js/dao/email-dao.js +++ b/src/js/dao/email-dao.js @@ -1171,14 +1171,14 @@ EmailDAO.prototype.onConnect = function(options, callback) { }); lastUid = uids[uids.length - 1]; - highestModseq = _.pluck(folder.messages, 'modseq').sort(function(a, b) { + highestModseq = (_.pluck(folder.messages, 'modseq').sort(function(a, b) { // We treat modseq values as numbers here as an exception, should // be strings everywhere else. // If it turns out that someone actually uses 64 bit uint numbers // that do not fit to the JavaScript number type then we should // use a helper for handling big integers. return (Number(a) || 0) - (Number(b) || 0); - }).pop().toString(); + }).pop() || 0).toString(); mailboxCache[folder.path] = { exists: lastUid,