diff options
author | Vitaly Takmazov | 2018-01-17 13:33:50 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2018-01-17 13:33:50 +0300 |
commit | 62df283157ff32dded77e833fbd0f4e3007acbbe (patch) | |
tree | 8e213bcc99b4f1679ba0d03ce6eef0cf8421156c /juick-xmpp/src/main/java/com/juick/xmpp/extensions | |
parent | 34e33eb5202570e8343382df7ca6a2e87385a611 (diff) |
prevent nulls with StringUtils.defaultString()
Diffstat (limited to 'juick-xmpp/src/main/java/com/juick/xmpp/extensions')
-rw-r--r-- | juick-xmpp/src/main/java/com/juick/xmpp/extensions/JuickMessage.java | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/juick-xmpp/src/main/java/com/juick/xmpp/extensions/JuickMessage.java b/juick-xmpp/src/main/java/com/juick/xmpp/extensions/JuickMessage.java index 86b4d02e..c28eee14 100644 --- a/juick-xmpp/src/main/java/com/juick/xmpp/extensions/JuickMessage.java +++ b/juick-xmpp/src/main/java/com/juick/xmpp/extensions/JuickMessage.java @@ -20,6 +20,7 @@ package com.juick.xmpp.extensions; import com.juick.Tag; import com.juick.xmpp.StanzaChild; import com.juick.xmpp.utils.XmlUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.commons.text.StringEscapeUtils; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserException; @@ -120,7 +121,7 @@ public class JuickMessage extends com.juick.Message implements StanzaChild { ret.append(JuickUser.toString(getUser())); } if (getText() != null) { - ret.append("<body>").append(StringEscapeUtils.escapeXml10(getText())).append("</body>"); + ret.append("<body>").append(StringEscapeUtils.escapeXml10(StringUtils.defaultString(getText()))).append("</body>"); } for (Tag Tag : getTags()) { ret.append("<tag>").append(StringEscapeUtils.escapeXml10(Tag.getName())).append("</tag>"); |