Skip to content

Commit

Permalink
check that position is not -1 when calling putItemEntry()
Browse files Browse the repository at this point in the history
  • Loading branch information
tolmachevroman committed Aug 22, 2018
1 parent b1e4129 commit 77eb7bd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ Lanes getLanes() {
}

void setItemEntryForPosition(int position, ItemEntry entry) {
if (mItemEntries != null) {
if (mItemEntries != null && position != -1) {
mItemEntries.putItemEntry(position, entry);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,11 @@ public void putItemEntry(int position, ItemEntry entry) {
}

public void restoreItemEntry(int position, ItemEntry entry) {
mRestoringItem = true;
putItemEntry(position, entry);
mRestoringItem = false;
if (position != -1) {
mRestoringItem = true;
putItemEntry(position, entry);
mRestoringItem = false;
}
}

public int size() {
Expand Down

0 comments on commit 77eb7bd

Please sign in to comment.