Fix NPE in FTS when snippet is null.
This commit is contained in:
parent
3731e2a74a
commit
6bc7f2a5a4
1 changed files with 7 additions and 3 deletions
|
@ -315,13 +315,17 @@ public class ConversationListItem extends RelativeLayout
|
||||||
unreadIndicator.setVisibility(View.VISIBLE);
|
unreadIndicator.setVisibility(View.VISIBLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
private Spanned getHighlightedSpan(@NonNull Locale locale,
|
private Spanned getHighlightedSpan(@NonNull Locale locale,
|
||||||
@Nullable String value,
|
@Nullable String value,
|
||||||
@Nullable String highlight)
|
@Nullable String highlight)
|
||||||
{
|
{
|
||||||
value = value != null ? value.replaceAll("\n", " ") : null;
|
if (value == null) {
|
||||||
|
return new SpannableString("");
|
||||||
|
}
|
||||||
|
|
||||||
if (value == null || highlight == null) {
|
value = value.replaceAll("\n", " ");
|
||||||
|
|
||||||
|
if (highlight == null) {
|
||||||
return new SpannableString(value);
|
return new SpannableString(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue