Skip to content

Commit a5dfa49

Browse files
committed
fix(core): check for handlers before trying to remove event from it
1 parent 53f81f2 commit a5dfa49

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libs/core/src/lib/instance.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ export function prepare<TInstance extends NgtAnyRecord = NgtAnyRecord>(
136136
return () => {
137137
const iS = getInstanceState(instance) as NgtInstanceState;
138138
if (iS) {
139-
delete iS.handlers[eventName];
139+
iS.handlers && delete iS.handlers[eventName];
140140
iS.eventCount -= 1;
141141
}
142142
};

0 commit comments

Comments
 (0)