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

Commit a8b4dcc8 authored by Fabrice Di Meglio's avatar Fabrice Di Meglio
Browse files

Fix bug #15611108 Stability: CursorIndexOutOfBoundsException in Settings:...

Fix bug #15611108 Stability: CursorIndexOutOfBoundsException in Settings: Index -1 requested, with a size of 1

- do not allow to have position < 0

A use case was generated by the Monkeys where they were capable to click on the Header.

Change-Id: I3a8ded4c1471a1589134826539c9db1b551f49dd
parent cbfda988
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -216,6 +216,11 @@ public class SearchResultsSummary extends Fragment {
            public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
                // We have a header, so we need to decrement the position by one
                position--;
                // Some Monkeys could create a case where they were probably clicking on the
                // List Header and thus the position passed was "0" and then by decrement was "-1"
                if (position < 0) {
                    return;
                }
                final Cursor cursor = mSuggestionsAdapter.mCursor;
                cursor.moveToPosition(position);