Skip to content

Commit b5d3ae6

Browse files
committed
fix(core): make sure previousAttach exists before invoking
1 parent c64c2cc commit b5d3ae6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libs/core/src/lib/utils/attach.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export function detach(parent: NgtAnyRecord, child: NgtAnyRecord, attachProp: st
2020
const childLocalState = getLocalState(child);
2121
if (childLocalState) {
2222
if (Array.isArray(attachProp)) attach(parent, childLocalState.previousAttach, attachProp, childLocalState.isRaw);
23-
else (childLocalState.previousAttach as () => void)();
23+
else (childLocalState.previousAttach as () => void)?.();
2424
}
2525
}
2626

0 commit comments

Comments
 (0)