瀏覽代碼

Safer check around component listener trigger (#5160)

Hugo Dozois 5 年之前
父節點
當前提交
51d1b66760
共有 1 個檔案被更改,包括 1 行新增1 行删除
  1. 1
    1
      lib/src/events/ComponentEventsObserver.ts

+ 1
- 1
lib/src/events/ComponentEventsObserver.ts 查看文件

@@ -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
     });