From 567fa62b7d084f8aa6af5e62244d3893467581c3 Mon Sep 17 00:00:00 2001 From: Victor Giers Date: Wed, 15 Apr 2026 15:02:14 +0200 Subject: [PATCH] Add null check for activeEntityPreview in viewport-host.ts --- src/viewport-three/viewport-host.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/viewport-three/viewport-host.ts b/src/viewport-three/viewport-host.ts index b247c098..cee7fcd7 100644 --- a/src/viewport-three/viewport-host.ts +++ b/src/viewport-three/viewport-host.ts @@ -1546,7 +1546,11 @@ export class ViewportHost { (item) => item.entityId === session.target.activeEntityId ); - switch (activeEntityPreview?.rotation.kind) { + if (activeEntityPreview === undefined) { + return null; + } + + switch (activeEntityPreview.rotation.kind) { case "yaw": return this.createRotationQuaternion({ x: 0,