diff options
author | Daniel Gultsch <daniel@gultsch.de> | 2016-05-19 10:40:03 +0200 |
---|---|---|
committer | Daniel Gultsch <daniel@gultsch.de> | 2016-05-19 10:40:03 +0200 |
commit | 627bf18f8cfa72aee3f410f22245403ff6a98ed0 (patch) | |
tree | 25b70c2befdb1129069a3af9ecc307f12e0af23b /src/main/java | |
parent | afa3883089ae8f827b1a6068db0a6efffb73485f (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.java | 9 |
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 225d05315..818ac1d65 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; |