Fix potential null access in external model instance selection check

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

View File

@@ -42,7 +42,7 @@ test("imports a gltf asset with external resources and places an instance", asyn
await viewportCanvas.click({ position: { x: 88, y: 84 } });
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();