From 28dab60232b9b8e18cbd5b5e66177f6843c60fa9 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Mon, 18 Nov 2013 15:09:34 -0500 Subject: [PATCH] resolving notifs issue, I hope --- src/user.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/user.js b/src/user.js index c40e17fa6d..43b5dfdb6c 100644 --- a/src/user.js +++ b/src/user.js @@ -1009,7 +1009,10 @@ var utils = require('./../public/src/utils.js'), next(null, notif_data); }); }, function(err, notifs) { - notifs = notifs.sort(function(a, b) { + notifs = notifs.filter(function(notif) { + if (notif !== null) return true; + else return false; + }).sort(function(a, b) { return parseInt(b.datetime, 10) - parseInt(a.datetime, 10); }).map(function(notif) { notif.datetimeISO = new Date(parseInt(notif.datetime, 10)).toISOString();