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

Commit 2df30e5c authored by Ben Lin's avatar Ben Lin
Browse files

Safe check so we don't move cursor beyond possible pos scope.

Bug: 28278372
Change-Id: I7c66b5229ae3a6a1b99bdf0f02bf1f0b8a1c79b2
parent 63aed6ad
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -163,7 +163,10 @@ public class Model {

        mCursor.moveToPosition(-1);
        for (int pos = 0; pos < mCursorCount; ++pos) {
            mCursor.moveToNext();
            if (!mCursor.moveToNext()) {
                Log.e(TAG, "Fail to move cursor to next pos: " + pos);
                return;
            }
            positions[pos] = pos;

            // Generates a Model ID for a cursor entry that refers to a document. The Model ID is a