From e89b2be1f13fdb3bd804eaa9233616b07bcdf6cd Mon Sep 17 00:00:00 2001 From: Livio Amstutz Date: Wed, 21 Jul 2021 11:23:55 +0200 Subject: [PATCH] fix: eventListener in input_suffix_offset.js (#2053) --- .../login/static/resources/scripts/input_suffix_offset.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/internal/ui/login/static/resources/scripts/input_suffix_offset.js b/internal/ui/login/static/resources/scripts/input_suffix_offset.js index ab8556b55b..fa706378e5 100644 --- a/internal/ui/login/static/resources/scripts/input_suffix_offset.js +++ b/internal/ui/login/static/resources/scripts/input_suffix_offset.js @@ -1,8 +1,10 @@ const suffix = document.getElementById('default-login-suffix'); const suffixInput = document.getElementsByClassName('lgn-suffix-input')[0]; -calculateOffset(); -suffix.addEventListener("DOMCharacterDataModified", calculateOffset); +if (suffix && suffixInput) { + calculateOffset(); + suffix.addEventListener("DOMCharacterDataModified", calculateOffset); +} function calculateOffset() { // add suffix width to inner right padding of the input field