From fb4aa5389924cb11fa8bf6489baf29ca8d7a6814 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Thu, 30 Jun 2016 12:06:48 +0300 Subject: fix parsing date --- src/main/java/com/juick/xmpp/extensions/JuickMessage.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/main/java/com/juick/xmpp') diff --git a/src/main/java/com/juick/xmpp/extensions/JuickMessage.java b/src/main/java/com/juick/xmpp/extensions/JuickMessage.java index a7fd1e35..ac45f3d2 100644 --- a/src/main/java/com/juick/xmpp/extensions/JuickMessage.java +++ b/src/main/java/com/juick/xmpp/extensions/JuickMessage.java @@ -83,7 +83,10 @@ public class JuickMessage extends com.juick.Message implements StanzaChild { jmsg.ReadOnly = true; } - jmsg.setDate(df.parse(parser.getAttributeValue(null, "ts"))); + String timestampString = parser.getAttributeValue(null, "ts"); + if (timestampString != null) { + jmsg.setDate(df.parse(timestampString)); + } jmsg.AttachmentType = parser.getAttributeValue(null, "attach"); while (parser.next() == XmlPullParser.START_TAG) { -- cgit v1.2.3