Skip to content
This repository has been archived by the owner on Sep 4, 2020. It is now read-only.

Commit

Permalink
Issue #824: JS error in Success callbackId: PushNotifiation###.. when…
Browse files Browse the repository at this point in the history
…ever a notification is sent to the device
  • Loading branch information
macdonst committed May 26, 2016
1 parent 7832d94 commit 7149db9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion www/push.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,12 @@ PushNotification.prototype.emit = function() {
}

for (var i = 0, length = this._handlers[eventName].length; i < length; i++) {
this._handlers[eventName][i].apply(undefined,args);
var callback = this._handlers[eventName][i];
if (typeof callback === 'function') {
callback.apply(undefined,args);
} else {
console.log('event handler: ' + eventName + ' must be a function');
}
}

return true;
Expand Down

0 comments on commit 7149db9

Please sign in to comment.