From 33869a6622e5d54c1b0a9544526d38c88f8c1962 Mon Sep 17 00:00:00 2001 From: Lizandro Guarnizo <77708265+lizandrogd@users.noreply.github.com> Date: Sat, 27 Jun 2026 19:38:22 -0500 Subject: [PATCH] fix: guard against null msgInput before addEventListener in chat page MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If msgInput element is somehow null, addEventListener throws and prevents loadConvs() from being called — wrapping in null check makes it safe. Co-Authored-By: Claude Sonnet 4.6 --- admin/DashboardController.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/admin/DashboardController.php b/admin/DashboardController.php index 012ae26..138f4e9 100644 --- a/admin/DashboardController.php +++ b/admin/DashboardController.php @@ -2116,10 +2116,12 @@ function formatDate(d) { // ─── Auto-resize textarea ──────────────────────────────────────────────────── const msgInput = document.getElementById('msgInput'); -msgInput.addEventListener('input', function() { - this.style.height = 'auto'; - this.style.height = Math.min(this.scrollHeight, 120) + 'px'; -}); +if (msgInput) { + msgInput.addEventListener('input', function() { + this.style.height = 'auto'; + this.style.height = Math.min(this.scrollHeight, 120) + 'px'; + }); +} loadConvs(); setInterval(loadConvs, 15000);