Skip to content

Commit

Permalink
Merge pull request #1910 from justinanastos/fix/restore-null-check-in…
Browse files Browse the repository at this point in the history
…-event-bus

fix(EventBus): add null check to handlers
  • Loading branch information
Dan Sparacio authored May 18, 2017
2 parents 35b4fe6 + e2167be commit 9403493
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 9403493

Please sign in to comment.