From ecba418ca83bcfcee459685616387d5101eeb99d Mon Sep 17 00:00:00 2001 From: Floens Date: Sun, 25 Oct 2015 13:41:46 +0100 Subject: [PATCH] Fix crash when trying to save the scroll state with no posts visible --- .../main/java/org/floens/chan/ui/layout/ThreadListLayout.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Clover/app/src/main/java/org/floens/chan/ui/layout/ThreadListLayout.java b/Clover/app/src/main/java/org/floens/chan/ui/layout/ThreadListLayout.java index 1a90a986..694ed4b0 100644 --- a/Clover/app/src/main/java/org/floens/chan/ui/layout/ThreadListLayout.java +++ b/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();