diff --git a/app/javascript/retrospring/features/questionbox/user.ts b/app/javascript/retrospring/features/questionbox/user.ts index e321f5b0..68d7170e 100644 --- a/app/javascript/retrospring/features/questionbox/user.ts +++ b/app/javascript/retrospring/features/questionbox/user.ts @@ -5,7 +5,12 @@ import I18n from 'retrospring/i18n'; export function questionboxUserHandler(event: Event): void { const button = event.target as HTMLButtonElement; const promote = button.dataset.promote === "true"; - const anonymousQuestion = document.querySelector('input[name=qb-anonymous]')?.checked; + const anonymousInput = document.querySelector('input[name=qb-anonymous]'); + let anonymousQuestion = true; + + if (anonymousInput) { + anonymousQuestion = anonymousInput.checked; + } document.querySelector('textarea[name=qb-question]').readOnly = true; button.disabled = true;