From 3e1c8f2f567f7ad248c2e45aad8684d54985fb1a Mon Sep 17 00:00:00 2001 From: Miodec Date: Fri, 15 Aug 2025 21:06:43 +0200 Subject: [PATCH] chore: return if element is null to avoid errors --- frontend/src/ts/elements/test-activity.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/frontend/src/ts/elements/test-activity.ts b/frontend/src/ts/elements/test-activity.ts index 18eae1268..bc1bc2c4c 100644 --- a/frontend/src/ts/elements/test-activity.ts +++ b/frontend/src/ts/elements/test-activity.ts @@ -111,7 +111,11 @@ export function initYearSelector( } function updateMonths(months: TestActivityMonth[]): void { - const element = document.querySelector(".testActivity .months") as Element; + const element = document.querySelector(".testActivity .months"); + + if (element === null) { + return; + } element.innerHTML = months .map(