# HG changeset patch # User Kim Alvefur # Date 1670189036 -3600 # Node ID 630887a50a7d1080956f6e8d5c4437fde1acfabc # Parent 2402ddabe7f719794a86352543725c5e45c211ec 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. diff -r 2402ddabe7f7 -r 630887a50a7d 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(); +} }); })();