diff --git a/src/messaging.js b/src/messaging.js index 2cb1fedf1d..78694627be 100644 --- a/src/messaging.js +++ b/src/messaging.js @@ -142,6 +142,9 @@ var db = require('./database'), async.waterfall([ async.apply(db.getObjects, keys), function(messages, next) { + + messages = messages.filter(Boolean); + async.map(messages, function(message, next) { var self = parseInt(message.fromuid, 10) === parseInt(fromuid, 10); message.fromUser = self ? userData[0] : userData[1];