From 379a48b77704cc0e933c07f60e79798af741fc89 Mon Sep 17 00:00:00 2001 From: IzabellaConigliaro Date: Mon, 4 Jun 2018 08:29:54 -0300 Subject: [PATCH] =?UTF-8?q?Adiciona=20verifica=C3=A7=C3=A3o=20de=20positio?= =?UTF-8?q?n.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/google/android/flexbox/FlexboxLayoutManager.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flexbox/src/main/java/com/google/android/flexbox/FlexboxLayoutManager.java b/flexbox/src/main/java/com/google/android/flexbox/FlexboxLayoutManager.java index 21bd2d53..ad51c367 100644 --- a/flexbox/src/main/java/com/google/android/flexbox/FlexboxLayoutManager.java +++ b/flexbox/src/main/java/com/google/android/flexbox/FlexboxLayoutManager.java @@ -2242,7 +2242,7 @@ private int computeScrollOffset(RecyclerView.State state) { int maxPosition = getPosition(lastReferenceView); int laidOutArea = Math.abs(mOrientationHelper.getDecoratedEnd(lastReferenceView) - mOrientationHelper.getDecoratedStart(firstReferenceView)); - int firstLinePosition = mFlexboxHelper.mIndexToFlexLine[minPosition]; + int firstLinePosition = minPosition != NO_POSITION ? mFlexboxHelper.mIndexToFlexLine[minPosition] : 0; if (firstLinePosition == 0 || firstLinePosition == NO_POSITION) { return 0; }