mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-24 13:08:46 +00:00
Protect against NPE in search.
This commit is contained in:
committed by
Nicholas Tinsley
parent
85449802d1
commit
97ea5dc45e
@@ -474,6 +474,14 @@ public class SearchRepository {
|
||||
int messageId = CursorUtil.requireInt(cursor, SearchTable.MESSAGE_ID);
|
||||
boolean isMms = CursorUtil.requireInt(cursor, SearchTable.IS_MMS) == 1;
|
||||
|
||||
if (body == null) {
|
||||
body = "";
|
||||
}
|
||||
|
||||
if (bodySnippet == null) {
|
||||
bodySnippet = "";
|
||||
}
|
||||
|
||||
return new MessageResult(conversationRecipient, messageRecipient, body, bodySnippet, threadId, messageId, receivedMs, isMms);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user