Explorar o código

Check if function is provided

Sebastián Katzer %!s(int64=10) %!d(string=hai) anos
pai
achega
3afb598550
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  1. 3 0
      www/local-notification-core.js

+ 3 - 0
www/local-notification-core.js

@@ -441,6 +441,9 @@ exports.registerPermission = function (callback, scope) {
  */
 exports.on = function (event, callback, scope) {
 
+    if (typeof callback !== "function")
+        return;
+
     if (!this._listener[event]) {
         this._listener[event] = [];
     }