Skip to content

Commit

Permalink
Safer check around component listener trigger (#5160)
Browse files Browse the repository at this point in the history
  • Loading branch information
dozoisch authored and guyca committed May 28, 2019
1 parent f2e46ea commit 51d1b66
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/src/events/ComponentEventsObserver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export class ComponentEventsObserver {

private triggerOnAllListenersByComponentId(event: ComponentEvent, method: string) {
_.forEach(this.listeners[event.componentId], (component) => {
if (component[method]) {
if (component && component[method]) {
component[method](event);
}
});
Expand Down

0 comments on commit 51d1b66

Please sign in to comment.