diff --git a/templates/main.js b/templates/main.js index 5a16297e..8e8bea88 100755 --- a/templates/main.js +++ b/templates/main.js @@ -349,8 +349,10 @@ function isDynamicCaptchaEnabled() { function initCaptcha() { if (isDynamicCaptchaEnabled()) { let captcha_hook = document.getElementById('captcha'); - captcha_hook.style = ""; - initCaptchaImpl(); + if (captcha_hook) { + captcha_hook.style = ""; + initCaptchaImpl(); + } } } {% endif %} // End if dynamic captcha