From 72ae2503aeb1af656873f7b379aaa460c0365688 Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Tue, 4 Jan 2022 01:40:44 +0100 Subject: [PATCH] Add null check to mute rule submits to prevent error flood --- app/javascript/retrospring/features/settings/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/javascript/retrospring/features/settings/index.ts b/app/javascript/retrospring/features/settings/index.ts index 3aa64226..138d756c 100644 --- a/app/javascript/retrospring/features/settings/index.ts +++ b/app/javascript/retrospring/features/settings/index.ts @@ -2,7 +2,7 @@ import {createDeleteEvent, createSubmitEvent} from "retrospring/features/setting export default (): void => { const submit: HTMLButtonElement = document.getElementById('new-rule-submit') as HTMLButtonElement; - if (submit.classList.contains('js-initialized')) return; + if (!submit || submit.classList.contains('js-initialized')) return; const rulesList = document.querySelector('.js-rules-list'); rulesList.querySelectorAll('.form-group:not(.js-initalized)').forEach(entry => {