diff --git a/mastodon/src/main/java/org/joinmastodon/android/ui/displayitems/HeaderStatusDisplayItem.java b/mastodon/src/main/java/org/joinmastodon/android/ui/displayitems/HeaderStatusDisplayItem.java index b090ea050..7adcd93a2 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/ui/displayitems/HeaderStatusDisplayItem.java +++ b/mastodon/src/main/java/org/joinmastodon/android/ui/displayitems/HeaderStatusDisplayItem.java @@ -378,11 +378,15 @@ public class HeaderStatusDisplayItem extends StatusDisplayItem{ more.setContentDescription(desc); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) more.setTooltipText(desc); - String collapseText = item.parentFragment.getString(item.status.textExpanded ? R.string.sk_collapse : R.string.sk_expand); - collapseBtn.setVisibility(item.status.textExpandable ? View.VISIBLE : View.GONE); - collapseBtn.setContentDescription(collapseText); - collapseBtn.animate().scaleY(item.status.textExpanded ? -1 : 1).start(); - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) collapseBtn.setTooltipText(collapseText); + if (item.status == null || !item.status.textExpandable) { + collapseBtn.setVisibility(View.GONE); + } else { + String collapseText = item.parentFragment.getString(item.status.textExpanded ? R.string.sk_collapse : R.string.sk_expand); + collapseBtn.setVisibility(item.status.textExpandable ? View.VISIBLE : View.GONE); + collapseBtn.setContentDescription(collapseText); + collapseBtn.animate().scaleY(item.status.textExpanded ? -1 : 1).start(); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) collapseBtn.setTooltipText(collapseText); + } } @Override