Browse Source

Safer check around component listener trigger (#5160)

Hugo Dozois 5 years ago
parent
commit
51d1b66760
1 changed files with 1 additions and 1 deletions
  1. 1
    1
      lib/src/events/ComponentEventsObserver.ts

+ 1
- 1
lib/src/events/ComponentEventsObserver.ts View File

@@ -94,7 +94,7 @@ export class ComponentEventsObserver {
94 94
 
95 95
   private triggerOnAllListenersByComponentId(event: ComponentEvent, method: string) {
96 96
     _.forEach(this.listeners[event.componentId], (component) => {
97
-      if (component[method]) {
97
+      if (component && component[method]) {
98 98
         component[method](event);
99 99
       }
100 100
     });