Fix possible NPE in AbsListView.positionSelector().

ListView was being reckless and calling the method with a null object in some
situations.

Change-Id: Ibb595a1ff6f916c699e4af55450966dd7fd8c156
This commit is contained in:
Romain Guy
2009-09-28 13:42:20 -07:00
parent aef439e6f8
commit b4c547a56c
2 changed files with 2 additions and 2 deletions

View File

@@ -1150,7 +1150,7 @@ public class GridView extends AbsListView {
mSelectedTop = sel.getTop();
} else if (mTouchMode > TOUCH_MODE_DOWN && mTouchMode < TOUCH_MODE_SCROLL) {
View child = getChildAt(mMotionPosition - mFirstPosition);
positionSelector(child);
if (child != null) positionSelector(child);
} else {
mSelectedTop = 0;
mSelectorRect.setEmpty();

View File

@@ -1567,7 +1567,7 @@ public class ListView extends AbsListView {
} else {
if (mTouchMode > TOUCH_MODE_DOWN && mTouchMode < TOUCH_MODE_SCROLL) {
View child = getChildAt(mMotionPosition - mFirstPosition);
positionSelector(child);
if (child != null) positionSelector(child);
} else {
mSelectedTop = 0;
mSelectorRect.setEmpty();