aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/eu/siacs
diff options
context:
space:
mode:
authoriNPUTmice <daniel@gultsch.de>2015-03-06 21:14:55 +0100
committeriNPUTmice <daniel@gultsch.de>2015-03-06 21:14:55 +0100
commit44028a547f23306cb8e88b0cb5b950e3c543fd34 (patch)
treee0773000bb923e5f519c9f29cb0961af1ee763dc /src/main/java/eu/siacs
parent16c6f8d2fff851f389c03eab2d3afb8e82547aab (diff)
fixed npe in message parser
Diffstat (limited to 'src/main/java/eu/siacs')
-rw-r--r--src/main/java/eu/siacs/conversations/parser/MessageParser.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/main/java/eu/siacs/conversations/parser/MessageParser.java b/src/main/java/eu/siacs/conversations/parser/MessageParser.java
index ced81520..6652842d 100644
--- a/src/main/java/eu/siacs/conversations/parser/MessageParser.java
+++ b/src/main/java/eu/siacs/conversations/parser/MessageParser.java
@@ -143,7 +143,7 @@ public class MessageParser extends AbstractParser implements
finishedMessage.setRemoteMsgId(packet.getId());
finishedMessage.markable = isMarkable(packet);
finishedMessage.setCounterpart(from);
- extractChatState(conversation,packet);
+ extractChatState(conversation, packet);
return finishedMessage;
} catch (Exception e) {
conversation.resetOtrSession();
@@ -408,11 +408,11 @@ public class MessageParser extends AbstractParser implements
.getAttribute("id");
updateLastseen(packet, account, true);
final Message displayedMessage = mXmppConnectionService.markMessage(account, from.toBareJid(), id, Message.STATUS_SEND_DISPLAYED);
- Message message = displayedMessage.prev();
- while(message != null
+ Message message = displayedMessage == null ? null :displayedMessage.prev();
+ while (message != null
&& message.getStatus() == Message.STATUS_SEND_RECEIVED
&& message.getTimeSent() < displayedMessage.getTimeSent()) {
- mXmppConnectionService.markMessage(message,Message.STATUS_SEND_DISPLAYED);
+ mXmppConnectionService.markMessage(message, Message.STATUS_SEND_DISPLAYED);
message = message.prev();
}
} else if (from != null