mod_http_muc_log: Fix error in js when displaying presence is disabled
authorKim Alvefur <zash@zash.se>
Sun, 04 Dec 2022 22:23:56 +0100
changeset 5110 630887a50a7d
parent 5109 2402ddabe7f7
child 5111 1e10ddbf5c87
mod_http_muc_log: Fix error in js when displaying presence is disabled When the form is hidden, attempting to index forms[0] throws an error, however this is harmless since the script is finished by that point.
mod_http_muc_log/static/timestamps.js
--- a/mod_http_muc_log/static/timestamps.js	Sun Dec 04 22:21:05 2022 +0100
+++ b/mod_http_muc_log/static/timestamps.js	Sun Dec 04 22:23:56 2022 +0100
@@ -12,8 +12,10 @@
 tag.setAttribute("title", date.toString());
 }
 }
+if(document.forms.length>0){
 document.forms[0].elements.p.addEventListener("change", function() {
 document.forms[0].submit();
+}
 });
 })();