Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7890fe2d authored by Romain Guy's avatar Romain Guy
Browse files

Don't pass a null View to OnListItemClickListener.

Bug #3365153

Change-Id: I1328a554408bf16ec592ae1a747e57a5fb9305e3
parent 2a83f001
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -2439,8 +2439,12 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te
            if (adapter != null && mItemCount > 0 &&
                    motionPosition != INVALID_POSITION &&
                    motionPosition < adapter.getCount() && sameWindow()) {
                performItemClick(getChildAt(motionPosition - mFirstPosition), motionPosition,
                        adapter.getItemId(motionPosition));
                final View view = getChildAt(motionPosition - mFirstPosition);
                // If there is no view, something bad happened (the view scrolled off the
                // screen, etc.) and we should cancel the click
                if (view != null) {
                    performItemClick(view, motionPosition, adapter.getItemId(motionPosition));
                }
            }
        }
    }