Make StreamOpen.toXML(String) 'null' aware

This commit is contained in:
Florian Schmaus 2018-09-11 09:42:08 +02:00
parent 271ac7ee7a
commit 5097f01b7a
1 changed files with 3 additions and 0 deletions

View File

@ -100,6 +100,9 @@ public class StreamOpen implements Nonza {
XmlStringBuilder xml = new XmlStringBuilder();
xml.halfOpenElement(getElementName());
// We always want to state 'xmlns' for stream open tags.
if (enclosingNamespace == null) {
enclosingNamespace = CLIENT_NAMESPACE;
}
xml.attribute("xmlns", enclosingNamespace);
xml.attribute("to", to);