Skip to content

Commit

Permalink
fix: _checkStreamError
Browse files Browse the repository at this point in the history
  • Loading branch information
Luiz-Monad authored and jcbrand committed May 7, 2024
1 parent fd5916e commit 88e7ac6
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/websocket.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,13 @@ class Websocket {

const ns = 'urn:ietf:params:xml:ns:xmpp-streams';
for (let i = 0; i < error.childNodes.length; i++) {
const e = error.children[i];
if (e.getAttribute('xmlns') !== ns) {
break;
const e = error.childNodes[i];
if (e.nodeType === e.ELEMENT_NODE) {
/** @type {Element} */
const el = /** @type {any} */ (e);
if (el.getAttribute('xmlns') !== ns) {
break;
}
}
if (e.nodeName === 'text') {
text = e.textContent;
Expand Down

0 comments on commit 88e7ac6

Please sign in to comment.