git » sdk » commit b5842ea

Don't add xmlns if not defined

author Stephen Paul Weber
2026-05-12 01:30:44 UTC
committer Stephen Paul Weber
2026-05-12 01:30:44 UTC
parent 546bb5a68fe6a811559259d37fbae5ed74d70690

Don't add xmlns if not defined

borogove/streams/XmppJsStream.hx +2 -1

diff --git a/borogove/streams/XmppJsStream.hx b/borogove/streams/XmppJsStream.hx
index 7a2e053..42d623e 100644
--- a/borogove/streams/XmppJsStream.hx
+++ b/borogove/streams/XmppJsStream.hx
@@ -407,7 +407,8 @@ class XmppJsStream extends GenericStream {
 				attrs.set("{" + el.findNS(parts[0]) + "}" + parts[1], val);
 			}
 		}
-		attrs.set("xmlns", el.getNS());
+		final ns = el.getNS();
+		if (ns != null) attrs.set("xmlns", ns);
 		var stanza = new Stanza(el.getName(), attrs);
 		for (child in el.children) {
 			if(XmppJsLtx.isText(child)) {