don't NPE on rare race condition while fetching MAM

This commit is contained in:
Daniel Gultsch 2016-05-19 10:40:03 +02:00
parent afa3883089
commit 627bf18f8c

View file

@ -492,6 +492,9 @@ public class Message extends AbstractEntity {
Message current = this; Message current = this;
while(current.mergeable(current.next())) { while(current.mergeable(current.next())) {
current = current.next(); current = current.next();
if (current == null) {
break;
}
body.append(MERGE_SEPARATOR); body.append(MERGE_SEPARATOR);
body.append(current.getBody().trim()); body.append(current.getBody().trim());
} }
@ -507,6 +510,9 @@ public class Message extends AbstractEntity {
Message current = this; Message current = this;
while(current.mergeable(current.next())) { while(current.mergeable(current.next())) {
current = current.next(); current = current.next();
if (current == null) {
break;
}
status = current.status; status = current.status;
} }
return status; return status;
@ -517,6 +523,9 @@ public class Message extends AbstractEntity {
Message current = this; Message current = this;
while(current.mergeable(current.next())) { while(current.mergeable(current.next())) {
current = current.next(); current = current.next();
if (current == null) {
break;
}
time = current.timeSent; time = current.timeSent;
} }
return time; return time;