mirror of
https://github.com/lacerta-doc/Lacerta.git
synced 2024-11-23 00:13:16 +00:00
getItemCountでインスタンス変数の中身を軽くチェックするように
This commit is contained in:
parent
9084613e38
commit
7086582fad
|
@ -34,7 +34,13 @@ public class ViewerViewPagerAdapter extends FragmentStateAdapter {
|
|||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return fragmentTargetIdList == null ? 0 : fragmentTargetIdList.size();
|
||||
if (fragmentTargetIdList == null || fragmentTitleList == null) {
|
||||
return 0;
|
||||
} else if (fragmentTargetIdList.size() != fragmentTitleList.size()) {
|
||||
throw new IllegalStateException("fragmentTargetIdList.size() != fragmentTitleList.size()");
|
||||
} else {
|
||||
return fragmentTargetIdList.size();
|
||||
}
|
||||
}
|
||||
|
||||
@Nullable
|
||||
|
|
Loading…
Reference in New Issue
Block a user