1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-12-22 02:27:58 +01:00

[tcp] Log XmlStringBuilder NPEs and the causing class

This commit is contained in:
Florian Schmaus 2020-06-15 17:52:28 +02:00
parent 5bd247c3e6
commit 018cba7f4f

View file

@ -1318,7 +1318,12 @@ public class XMPPTCPConnection extends AbstractXMPPConnection {
CharSequence elementXml = element.toXML(outgoingStreamXmlEnvironment);
if (elementXml instanceof XmlStringBuilder) {
((XmlStringBuilder) elementXml).write(writer, outgoingStreamXmlEnvironment);
try {
((XmlStringBuilder) elementXml).write(writer, outgoingStreamXmlEnvironment);
} catch (NullPointerException npe) {
LOGGER.log(Level.FINE, "NPE in XmlStringBuilder of " + element.getClass() + ": " + element, npe);
throw npe;
}
}
else {
writer.write(elementXml.toString());