changeset 5106:630887a50a7d

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.
author Kim Alvefur <zash@zash.se>
date Sun, 04 Dec 2022 22:23:56 +0100
parents 2402ddabe7f7
children 1e10ddbf5c87
files mod_http_muc_log/static/timestamps.js
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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();
+}
 });
 })();