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:
@@ -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();
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user