diff --git a/frontend/main.ts b/frontend/main.ts index c6cb39c..a3a5644 100644 --- a/frontend/main.ts +++ b/frontend/main.ts @@ -71,9 +71,10 @@ function initBoatActions() { const rowers = Number(select.dataset.seats) - 1; choiceObjects['newrower'].config.maxItemCount = rowers; choiceObjects['newrower'].removeActiveItems(rowers); - let boatSelect = document.querySelector('#boat_id'); - choiceObjects['boat_id'].setChoiceByValue(select.dataset.id); + if (select.dataset.id) { + choiceObjects['boat_id'].setChoiceByValue(select.dataset.id); + } (rowers === 0 ? choiceObjects['newrower'].disable() : choiceObjects['newrower'].enable()); }