From 040087a8283b35169f6eec222f981528b4ceb124 Mon Sep 17 00:00:00 2001 From: Patrick de Klein Date: Mon, 17 Feb 2025 12:14:13 +0100 Subject: [PATCH] fix: check if there are active items --- src/lib/qti-test/components/test-print-item-variables.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lib/qti-test/components/test-print-item-variables.ts b/src/lib/qti-test/components/test-print-item-variables.ts index 92f49194..90dbfe98 100644 --- a/src/lib/qti-test/components/test-print-item-variables.ts +++ b/src/lib/qti-test/components/test-print-item-variables.ts @@ -21,6 +21,7 @@ export class TestPrintVariables extends LitElement { const activeItems = this.computedContext?.testParts.flatMap(testPart => testPart.sections.flatMap(section => section.items).find(item => item.active) ); + if (!activeItems) return html``; const activeItem = activeItems.length > 0 ? activeItems[0] : null; if (activeItem) { const responseVariables: ResponseVariable[] = activeItem.variables?.filter(v => {