forked from mirror/monocles_chat_clean
Handle null message body when persisting
Some checks are pending
Android CI / build (pull_request) Waiting to run
Some checks are pending
Android CI / build (pull_request) Waiting to run
This commit is contained in:
parent
c22a200a63
commit
5ad95666c2
1 changed files with 9 additions and 5 deletions
|
|
@ -497,11 +497,15 @@ public class Message extends AbstractEntity implements AvatarService.Avatarable
|
|||
} else {
|
||||
values.put(TRUE_COUNTERPART, trueCounterpart.toString());
|
||||
}
|
||||
values.put(
|
||||
BODY,
|
||||
body.length() > Config.MAX_STORAGE_MESSAGE_CHARS
|
||||
? body.substring(0, Config.MAX_STORAGE_MESSAGE_CHARS)
|
||||
: body);
|
||||
if (body == null) {
|
||||
values.putNull(BODY);
|
||||
} else {
|
||||
values.put(
|
||||
BODY,
|
||||
body.length() > Config.MAX_STORAGE_MESSAGE_CHARS
|
||||
? body.substring(0, Config.MAX_STORAGE_MESSAGE_CHARS)
|
||||
: body);
|
||||
}
|
||||
values.put(TIME_SENT, timeSent);
|
||||
values.put(ENCRYPTION, encryption);
|
||||
values.put(STATUS, status);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue