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

Commit 5d80fd29 authored by Fan Zhang's avatar Fan Zhang
Browse files

Fix a monkey crash: guard against position -1.

When handling onClick in ManageApplications, skip getAppEntry if
position is -1.

Change-Id: I565c42b2c9f742445e49fd4c2e7db539d0f6f8ad
Fixes: 67940121
Test: manual
parent 78369d91
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -647,6 +647,10 @@ public class ManageApplications extends InstrumentedPreferenceFragment
        }
        final int position = mRecyclerView.getChildAdapterPosition(view);

        if (position == RecyclerView.NO_POSITION) {
            Log.w(TAG, "Cannot find position for child, skipping onClick handling");
            return;
        }
        if (mApplications.getApplicationCount() > position) {
            ApplicationsState.AppEntry entry = mApplications.getAppEntry(position);
            mCurrentPkgName = entry.info.packageName;