From ab89941ed5e787b596edecc7a8f5d1421809e924 Mon Sep 17 00:00:00 2001 From: Matteo Pagliazzi Date: Sun, 4 Feb 2018 14:04:41 +0100 Subject: [PATCH] notifications: fix tests --- website/server/models/userNotification.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/website/server/models/userNotification.js b/website/server/models/userNotification.js index 9add87cc13..4ddc5c6883 100644 --- a/website/server/models/userNotification.js +++ b/website/server/models/userNotification.js @@ -71,6 +71,8 @@ export let schema = new Schema({ * is fixed */ schema.statics.convertNotificationsToSafeJson = function convertNotificationsToSafeJson (notifications) { + if (!notifications) return notifications; + return notifications.filter(n => { // Exclude notifications with a nullish value if (!n) return false;