diff --git a/mastodon/src/main/java/org/joinmastodon/android/fragments/BaseStatusListFragment.java b/mastodon/src/main/java/org/joinmastodon/android/fragments/BaseStatusListFragment.java index 1af939d60..96480351e 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/fragments/BaseStatusListFragment.java +++ b/mastodon/src/main/java/org/joinmastodon/android/fragments/BaseStatusListFragment.java @@ -34,6 +34,7 @@ import org.joinmastodon.android.model.Relationship; import org.joinmastodon.android.model.Status; import org.joinmastodon.android.ui.BetterItemAnimator; import org.joinmastodon.android.ui.displayitems.ExtendedFooterStatusDisplayItem; +import org.joinmastodon.android.ui.displayitems.FooterStatusDisplayItem; import org.joinmastodon.android.ui.displayitems.GapStatusDisplayItem; import org.joinmastodon.android.ui.displayitems.HeaderStatusDisplayItem; import org.joinmastodon.android.ui.displayitems.MediaGridStatusDisplayItem; @@ -384,7 +385,9 @@ public abstract class BaseStatusListFragment exten } // shifting the selection box down // see also: FooterStatusDisplayItem#onBind (setMargins) - if (isWarning || firstIndex < 0 || lastIndex < 0) return; + if (isWarning || firstIndex < 0 || lastIndex < 0 || + !(list.getChildViewHolder(list.getChildAt(lastIndex)) + instanceof FooterStatusDisplayItem.Holder)) return; int prevIndex = firstIndex - 1, nextIndex = lastIndex + 1; boolean prevIsWarning = prevIndex > 0 && prevIndex < list.getChildCount() && list.getChildViewHolder(list.getChildAt(prevIndex))