main.js: do not initialize captchas if there is no hook

This commit is contained in:
Zankaria 2024-08-23 14:36:12 +02:00
parent 111fa78921
commit 3994afd10d

View file

@ -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