diff --git a/mastodon/src/main/java/org/joinmastodon/android/fragments/IsOnTop.java b/mastodon/src/main/java/org/joinmastodon/android/fragments/IsOnTop.java index 3b1c999e9..071e44775 100644 --- a/mastodon/src/main/java/org/joinmastodon/android/fragments/IsOnTop.java +++ b/mastodon/src/main/java/org/joinmastodon/android/fragments/IsOnTop.java @@ -1,11 +1,13 @@ package org.joinmastodon.android.fragments; +import androidx.annotation.Nullable; import androidx.recyclerview.widget.RecyclerView; public interface IsOnTop { boolean isOnTop(); - default boolean isRecyclerViewOnTop(RecyclerView list) { + default boolean isRecyclerViewOnTop(@Nullable RecyclerView list) { + if (list == null) return true; return !list.canScrollVertically(-1); } }