From 3350a89791be91a05a6fc373bcf4485a2e2baf3b Mon Sep 17 00:00:00 2001
From: Peter Jaszkowiak
Date: Tue, 25 Apr 2017 15:27:12 -0600
Subject: [PATCH] Allow aborting notification push
---
src/notifications.js | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/notifications.js b/src/notifications.js
index 147ae7fea4..b7000dc124 100644
--- a/src/notifications.js
+++ b/src/notifications.js
@@ -191,6 +191,10 @@ var utils = require('./utils');
plugins.fireHook('filter:notification.push', { notification: notification, uids: uids }, next);
},
function (data, next) {
+ if (!data || !data.notification) {
+ return callback();
+ }
+
uids = data.uids;
notification = data.notification;