notifications: fix tests

This commit is contained in:
Matteo Pagliazzi
2018-02-04 14:04:41 +01:00
parent d46a7ba985
commit ab89941ed5

View File

@@ -71,6 +71,8 @@ export let schema = new Schema({
* is fixed * is fixed
*/ */
schema.statics.convertNotificationsToSafeJson = function convertNotificationsToSafeJson (notifications) { schema.statics.convertNotificationsToSafeJson = function convertNotificationsToSafeJson (notifications) {
if (!notifications) return notifications;
return notifications.filter(n => { return notifications.filter(n => {
// Exclude notifications with a nullish value // Exclude notifications with a nullish value
if (!n) return false; if (!n) return false;