From 79303750df0e4d18f51f64c7ef3ca21fca893bbb Mon Sep 17 00:00:00 2001 From: Adam Powell Date: Thu, 13 Jan 2011 22:06:49 -0800 Subject: [PATCH] Fix bug 3352112 - crash in AbsListView.smoothScrollBy Change-Id: I00b4e5855a1c0861993670a38ed2cd946fd18594 --- core/java/android/widget/AbsListView.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/core/java/android/widget/AbsListView.java b/core/java/android/widget/AbsListView.java index 2e38743b95b72..7631df49e6bb3 100644 --- a/core/java/android/widget/AbsListView.java +++ b/core/java/android/widget/AbsListView.java @@ -4106,8 +4106,7 @@ public abstract class AbsListView extends AdapterView implements Te final int topLimit = getPaddingTop(); final int bottomLimit = getHeight() - getPaddingBottom(); - if (distance == 0 || - firstPos == INVALID_POSITION || + if (distance == 0 || mItemCount == 0 || childCount == 0 || (firstPos == 0 && getChildAt(0).getTop() == topLimit && distance < 0) || (lastPos == mItemCount - 1 && getChildAt(childCount - 1).getBottom() == bottomLimit && distance > 0)) {