[ticket/17326] Check for existence of font icon element before use

PHPBB-17326
This commit is contained in:
Marc Alexander 2025-02-15 10:42:47 +01:00
parent 220b655150
commit bf15d1ea42
No known key found for this signature in database
GPG key ID: 50E0D2423696F995

View file

@ -291,12 +291,14 @@ function parse_document(container)
const pageIconFont = document.getElementById('bbcode_font_icon');
pageIconFont.addEventListener('keyup', function() {
updateIconClass(this.nextElementSibling, this.value);
});
if (pageIconFont) {
pageIconFont.addEventListener('keyup', function () {
updateIconClass(this.nextElementSibling, this.value);
});
pageIconFont.addEventListener('blur', function() {
updateIconClass(this.nextElementSibling, this.value);
});
pageIconFont.addEventListener('blur', function () {
updateIconClass(this.nextElementSibling, this.value);
});
}
});
})(jQuery);