Skip to content

Commit dde7464

Browse files
authored
Merge pull request CymChad#1668 from GeekTR/master
修复快速点击崩溃的bug
2 parents 03665c1 + 37bbc6e commit dde7464

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

library/src/main/java/com/chad/library/adapter/base/BaseMultiItemQuickAdapter.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import android.support.annotation.IntRange;
44
import android.support.annotation.LayoutRes;
5+
import android.util.Log;
56
import android.util.SparseIntArray;
67
import android.view.ViewGroup;
78

@@ -65,7 +66,9 @@ protected void addItemType(int type, @LayoutRes int layoutResId) {
6566

6667
@Override
6768
public void remove(@IntRange(from = 0L) int position) {
68-
if (mData == null || position >= mData.size()) return;
69+
if (mData == null
70+
|| position < 0
71+
|| position >= mData.size()) return;
6972

7073
T entity = mData.get(position);
7174
if (entity instanceof IExpandable) {

0 commit comments

Comments
 (0)