aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel@gultsch.de>2016-05-19 10:40:03 +0200
committerDaniel Gultsch <daniel@gultsch.de>2016-05-19 10:40:03 +0200
commit627bf18f8cfa72aee3f410f22245403ff6a98ed0 (patch)
tree25b70c2befdb1129069a3af9ecc307f12e0af23b /src/main/java
parentafa3883089ae8f827b1a6068db0a6efffb73485f (diff)
don't NPE on rare race condition while fetching MAM
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/eu/siacs/conversations/entities/Message.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/main/java/eu/siacs/conversations/entities/Message.java b/src/main/java/eu/siacs/conversations/entities/Message.java
index 225d0531..818ac1d6 100644
--- a/src/main/java/eu/siacs/conversations/entities/Message.java
+++ b/src/main/java/eu/siacs/conversations/entities/Message.java
@@ -492,6 +492,9 @@ public class Message extends AbstractEntity {
Message current = this;
while(current.mergeable(current.next())) {
current = current.next();
+ if (current == null) {
+ break;
+ }
body.append(MERGE_SEPARATOR);
body.append(current.getBody().trim());
}
@@ -507,6 +510,9 @@ public class Message extends AbstractEntity {
Message current = this;
while(current.mergeable(current.next())) {
current = current.next();
+ if (current == null) {
+ break;
+ }
status = current.status;
}
return status;
@@ -517,6 +523,9 @@ public class Message extends AbstractEntity {
Message current = this;
while(current.mergeable(current.next())) {
current = current.next();
+ if (current == null) {
+ break;
+ }
time = current.timeSent;
}
return time;