Commit 8cd74e5b by Sebastián Katzer

Fixes #557 Cannot call method 'apply' of undefined

parent 28ab02b7
...@@ -441,6 +441,9 @@ exports.registerPermission = function (callback, scope) { ...@@ -441,6 +441,9 @@ exports.registerPermission = function (callback, scope) {
*/ */
exports.on = function (event, callback, scope) { exports.on = function (event, callback, scope) {
if (typeof callback !== "function")
return;
if (!this._listener[event]) { if (!this._listener[event]) {
this._listener[event] = []; this._listener[event] = [];
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment