Skip to content

Commit

Permalink
Merge pull request #486 from AllenCoder/master
Browse files Browse the repository at this point in the history
fix 474 crash when clicking on header sometime
  • Loading branch information
CymChad authored Nov 8, 2016
2 parents a7afefa + 9bcd10b commit b564377
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,13 @@ private boolean isHeaderOrFooterPosition(int position) {
/**
* have a headview and EMPTY_VIEW FOOTER_VIEW LOADING_VIEW
*/
if (baseQuickAdapter==null){
if (recyclerView!=null){
baseQuickAdapter= (BaseQuickAdapter) recyclerView.getAdapter();
}else {
return false;
}
}
int type = baseQuickAdapter.getItemViewType(position);
return (type == EMPTY_VIEW || type == HEADER_VIEW || type == FOOTER_VIEW || type == LOADING_VIEW);
}
Expand Down

0 comments on commit b564377

Please sign in to comment.