From 5c2522942931255934643b576edf52696c167983 Mon Sep 17 00:00:00 2001 From: Russell Ballestrini Date: Sun, 30 Nov 2025 14:56:04 -0500 Subject: [PATCH] Fix classList check for non-element nodes - Add null check for classList before calling contains() - Handles case where nextSibling might be a text node - Prevents 'classList is undefined' error --- templates/chat.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/chat.html b/templates/chat.html index 3005767..5ddfc94 100644 --- a/templates/chat.html +++ b/templates/chat.html @@ -957,7 +957,7 @@ socket.on("chat_message", (data) => { // Find or create results container and set attempt count // Results container goes after the button container (which is after the
)
                         let resultsContainer = buttonContainer?.nextSibling;
-                        if (!resultsContainer || !resultsContainer.classList.contains('code-execution-results')) {
+                        if (!resultsContainer || !resultsContainer.classList || !resultsContainer.classList.contains('code-execution-results')) {
                             resultsContainer = document.createElement('div');
                             resultsContainer.classList.add('code-execution-results');
                             resultsContainer.style.marginTop = '10px';