From ea1041aa73b03b667d701ff8fafa7daeb68d0d24 Mon Sep 17 00:00:00 2001 From: philipp Date: Tue, 31 Oct 2023 21:08:57 +0100 Subject: [PATCH] fix node ci --- frontend/main.ts | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/frontend/main.ts b/frontend/main.ts index 6e9f387..5a4d8ff 100644 --- a/frontend/main.ts +++ b/frontend/main.ts @@ -132,13 +132,21 @@ function setMaxAmountRowers(name: string, rowers: number) { let shipmaster = document.querySelector('#shipmaster-newrowerjs'); let steering_person = document.querySelector('#steering_person-newrowerjs'); if (rowers == 1){ - shipmaster.parentNode.classList.add('hidden'); - steering_person.parentNode.classList.add('hidden'); + if (shipmaster.parentNode) { + (shipmaster.parentNode).classList.add('hidden'); + } + if (steering_person.parentNode){ + (steering_person.parentNode).classList.add('hidden'); + } }else{ - shipmaster.parentNode.classList.remove('hidden'); + if (shipmaster.parentNode){ + (shipmaster.parentNode).classList.remove('hidden'); + } shipmaster.setAttribute('required', 'required'); - steering_person.parentNode.classList.remove('hidden'); + if (steering_person.parentNode){ + (steering_person.parentNode).classList.remove('hidden'); + } steering_person.setAttribute('required', 'required'); } }