Handle null message body when persisting
Some checks are pending
Android CI / build (pull_request) Waiting to run

This commit is contained in:
Arne 2026-04-16 21:39:36 +02:00
commit 5ad95666c2

View file

@ -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);