Fix potential null access in Draco model instance selection check

This commit is contained in:
2026-04-03 00:03:04 +02:00
parent 63ab9afc9c
commit 3bebd4116d

View File

@@ -38,7 +38,7 @@ test("imports a draco-compressed glb asset, places an instance, and survives rel
await viewportCanvas.click({ position: { x: 84, y: 88 } });
await expect(page.getByTestId("outliner-model-instance-list").getByRole("button")).toHaveCount(2);
const snapshot = await getEditorStoreSnapshot(page);
const selectedModelInstanceId = snapshot.selection.kind === "modelInstances" ? snapshot.selection.ids[0] ?? null : null;
const selectedModelInstanceId = snapshot.selection.kind === "modelInstances" ? snapshot.selection.ids?.[0] ?? null : null;
expect(selectedModelInstanceId).not.toBeNull();