mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-09-04 03:43:31 +02:00
notifications.create can return null
This commit is contained in:
@@ -50,14 +50,11 @@ module.exports = function(User) {
|
||||
nid: 'new_register:' + username,
|
||||
path: '/admin/manage/registration'
|
||||
}, function(err, notification) {
|
||||
if (err) {
|
||||
if (err || !notification) {
|
||||
return callback(err);
|
||||
}
|
||||
if (notification) {
|
||||
notifications.pushGroup(notification, 'administrators', callback);
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
|
||||
notifications.pushGroup(notification, 'administrators', callback);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -295,14 +295,11 @@ var async = require('async'),
|
||||
path: path,
|
||||
nid: 'welcome_' + uid
|
||||
}, function(err, notification) {
|
||||
if (err) {
|
||||
if (err || !notification) {
|
||||
return callback(err);
|
||||
}
|
||||
if (notification) {
|
||||
notifications.push(notification, [uid], callback);
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
|
||||
notifications.push(notification, [uid], callback);
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user