fix race condition at push service
This commit is contained in:
parent
1d629c5674
commit
ff89650337
|
@ -189,7 +189,7 @@ PushNotificationsService.prototype._checkShouldSendNotif = function(notification
|
|||
|
||||
if (notification.type != 'NewTxProposal') return cb(null, true);
|
||||
self.storage.fetchWallet(notification.walletId, function(err, wallet) {
|
||||
return cb(err, wallet.m > 1);
|
||||
return cb(err, wallet && wallet.m > 1);
|
||||
});
|
||||
};
|
||||
|
||||
|
@ -297,7 +297,7 @@ PushNotificationsService.prototype._getDataForTemplate = function(notification,
|
|||
}
|
||||
|
||||
self.storage.fetchWallet(notification.walletId, function(err, wallet) {
|
||||
if (err) return cb(err);
|
||||
if (err || !wallet) return cb(err);
|
||||
|
||||
data.walletId = wallet.id;
|
||||
data.walletName = wallet.name;
|
||||
|
|
Loading…
Reference in New Issue