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
This commit is contained in:
parent
36e713147a
commit
5c25229429
1 changed files with 1 additions and 1 deletions
|
|
@ -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 <pre>)
|
||||
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';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue