mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-05-08 09:18:39 +01: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);
|
int messageId = CursorUtil.requireInt(cursor, SearchTable.MESSAGE_ID);
|
||||||
boolean isMms = CursorUtil.requireInt(cursor, SearchTable.IS_MMS) == 1;
|
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);
|
return new MessageResult(conversationRecipient, messageRecipient, body, bodySnippet, threadId, messageId, receivedMs, isMms);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user