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); LinkHelper.setClickableText(statusContent, emojifiedText, statusViewData.getMentions(), listener);
CharSequence emojifiedContentWarning = CustomEmojiHelper.emojify( CharSequence emojifiedContentWarning;
statusViewData.getSpoilerText(), if (statusViewData.getSpoilerText() != null) {
statusViewData.getStatusEmojis(), emojifiedContentWarning = CustomEmojiHelper.emojify(
contentWarningDescriptionTextView, statusViewData.getSpoilerText(),
statusDisplayOptions.animateEmojis() statusViewData.getStatusEmojis(),
); contentWarningDescriptionTextView,
statusDisplayOptions.animateEmojis()
);
} else {
emojifiedContentWarning = "";
}
contentWarningDescriptionTextView.setText(emojifiedContentWarning); contentWarningDescriptionTextView.setText(emojifiedContentWarning);
} }