Skip to content

Commit f42a9fe

Browse files
committed
fix(core): optional chaining on renderer state as it can be null during nullifying state of previous object downstream
The custom materials were erroring out because we nullifying previous object renderer state in a computed. That happens BEFORE *args receives the new computed and destroy the ref.
1 parent a560270 commit f42a9fe

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libs/core/src/lib/renderer/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ export class NgtRenderer implements Renderer2 {
288288
removeChild(parent: NgtRendererNode | null, oldChild: NgtRendererNode, isHostElement?: boolean | undefined): void {
289289
if (parent == null) {
290290
parent = (untracked(() => getLocalState(oldChild)?.parent?.()) ||
291-
oldChild.__ngt_renderer__[NgtRendererClassId.parent]) as NgtRendererNode;
291+
oldChild.__ngt_renderer__?.[NgtRendererClassId.parent]) as NgtRendererNode;
292292
}
293293

294294
const cRS = oldChild.__ngt_renderer__;

0 commit comments

Comments
 (0)