Skip to content

Commit d8aa85d

Browse files
committed
fix(soba): null check for onBeforeRender in intersect
1 parent f25cb5b commit d8aa85d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libs/soba/misc/src/lib/intersect.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export function injectIntersect<TObject extends THREE.Object3D>(
2222
});
2323

2424
// If the object is inside the frustum three will call onRender
25-
const oldOnRender = obj.onBeforeRender.bind(obj);
25+
const oldOnRender = obj.onBeforeRender?.bind(obj);
2626
obj.onBeforeRender = () => (check = true);
2727

2828
// Compare the check value against the temp value, if it differs set state

0 commit comments

Comments
 (0)