1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-11-29 07:22:07 +01:00

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

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);