Skip to content

Commit 3106b79

Browse files
Chau TranChau Tran
Chau Tran
authored and
Chau Tran
committed
fix(soba): null check shadow.map in spotlight mesh
1 parent 37edaa3 commit 3106b79

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

libs/soba/staging/src/spot-light/spot-light-shadow-mesh.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@ function injectShadowMeshCommon(
4646
if (!spotLight) return;
4747
if (isSpotLight(spotLight)) {
4848
spotLight.shadow.mapSize.set(width(), height());
49-
spotLight.shadow.map.setSize(width(), height());
49+
if (spotLight.shadow.map) {
50+
spotLight.shadow.map.setSize(width(), height());
51+
}
5052
spotLight.shadow.needsUpdate = true;
5153
} else {
5254
throw new Error('<ngts-spot-light-shadow> must be a child of a <ngts-spot-light>');

0 commit comments

Comments
 (0)