Fix crash when trying to save the scroll state with no posts visible

multisite
Floens 10 years ago
parent 67f725f140
commit ecba418ca8
  1. 2
      Clover/app/src/main/java/org/floens/chan/ui/layout/ThreadListLayout.java

@ -108,7 +108,7 @@ public class ThreadListLayout extends FrameLayout implements ReplyLayout.ReplyLa
if (showingThread != null) {
int index = 0;
int top = 0;
if (recyclerView.getChildCount() > 0) {
if (recyclerView.getLayoutManager().getChildCount() > 0) {
View topChild = recyclerView.getLayoutManager().getChildAt(0);
index = ((RecyclerView.LayoutParams) topChild.getLayoutParams()).getViewLayoutPosition();

Loading…
Cancel
Save