Skip to content

Commit

Permalink
fix(EventBus): add null check to handlers
Browse files Browse the repository at this point in the history
  • Loading branch information
justinanastos committed May 3, 2017
1 parent 7f84b0a commit e2167be
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/EventBus.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ function EventBus() {
payload.type = type;

handlers[type] = handlers[type].filter((item) => item);
handlers[type].forEach( handler => handler.callback.call(handler.scope, payload) );
handlers[type].forEach( handler => handler && handler.callback.call(handler.scope, payload) );
}

function getHandlerIdx(type, listener, scope) {
Expand Down

0 comments on commit e2167be

Please sign in to comment.