Skip to content

Commit

Permalink
Merge pull request CymChad#1822 from zzzlw/master
Browse files Browse the repository at this point in the history
修改使用泛型时的一点小错误(可以看原来代码警告), 修改为判空增加代码健壮性。
  • Loading branch information
CymChad authored Dec 13, 2017
2 parents d4acb0b + 59673e4 commit a7d0d06
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ public BaseMultiItemQuickAdapter(List<T> data) {

@Override
protected int getDefItemViewType(int position) {
Object item = mData.get(position);
if (item instanceof MultiItemEntity) {
return ((MultiItemEntity) item).getItemType();
T item = mData.get(position);
if (item != null) {
return item.getItemType();
}
return DEFAULT_VIEW_TYPE;
}
Expand Down

0 comments on commit a7d0d06

Please sign in to comment.