Fix crash in NotificationsAdapter when spoiler is null. (#2178)

This commit is contained in:
Ivan Kupalov 2021-05-27 16:41:54 +02:00 committed by GitHub
parent d5e539fd64
commit 59c62204c7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -643,12 +643,17 @@ public class NotificationsAdapter extends RecyclerView.Adapter {
);
LinkHelper.setClickableText(statusContent, emojifiedText, statusViewData.getMentions(), listener);
CharSequence emojifiedContentWarning = CustomEmojiHelper.emojify(
statusViewData.getSpoilerText(),
statusViewData.getStatusEmojis(),
contentWarningDescriptionTextView,
statusDisplayOptions.animateEmojis()
);
CharSequence emojifiedContentWarning;
if (statusViewData.getSpoilerText() != null) {
emojifiedContentWarning = CustomEmojiHelper.emojify(
statusViewData.getSpoilerText(),
statusViewData.getStatusEmojis(),
contentWarningDescriptionTextView,
statusDisplayOptions.animateEmojis()
);
} else {
emojifiedContentWarning = "";
}
contentWarningDescriptionTextView.setText(emojifiedContentWarning);
}