Merge "Safe check so we don\'t move cursor beyond possible pos scope." into nyc-dev am: 2360aa3

am: 88dc2f0

* commit '88dc2f020e05d15d1c4fb45716dbd2cb5b03c7ae':
  Safe check so we don't move cursor beyond possible pos scope.

Change-Id: I6ae85c53f8ac8e5deca816093f27eed5b341aa60
This commit is contained in:
Ben Lin
2016-04-27 20:51:50 +00:00
committed by android-build-merger

View File

@@ -149,7 +149,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