Skip to content

Commit

Permalink
avoid crash of IndexOutOfBoundsException
Browse files Browse the repository at this point in the history
  • Loading branch information
SilenceDut committed Jun 26, 2019
1 parent 0dfbfa1 commit dd664f9
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,12 @@ public void insertData(final int startPosition, final List<? extends BaseMutable
mDifferHelper.updateOldListSize(new Runnable() {
@Override
public void run() {
mDatas.addAll(startPosition, datas);
if (startPosition > datas.size()) {
mDatas.addAll(datas);
} else {
mDatas.addAll(startPosition, datas);
}

notifyItemRangeInserted(startPosition, datas.size());
}
}, mDatas);
Expand Down

0 comments on commit dd664f9

Please sign in to comment.