aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/eu/siacs/conversations/entities/Message.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/eu/siacs/conversations/entities/Message.java')
-rw-r--r--src/main/java/eu/siacs/conversations/entities/Message.java5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/main/java/eu/siacs/conversations/entities/Message.java b/src/main/java/eu/siacs/conversations/entities/Message.java
index 1b38d349..4ff08275 100644
--- a/src/main/java/eu/siacs/conversations/entities/Message.java
+++ b/src/main/java/eu/siacs/conversations/entities/Message.java
@@ -124,7 +124,7 @@ public class Message extends AbstractEntity {
this.conversationUuid = conversationUUid;
this.counterpart = counterpart;
this.trueCounterpart = trueCounterpart;
- this.body = body;
+ this.body = body == null ? "" : body;
this.timeSent = timeSent;
this.encryption = encryption;
this.status = status;
@@ -266,6 +266,9 @@ public class Message extends AbstractEntity {
}
public void setBody(String body) {
+ if (body == null) {
+ throw new Error("You should not set the message body to null");
+ }
this.body = body;
}