Skip to content

Commit 2fd3494

Browse files
committed
修复issue#25
1 parent e29caa4 commit 2fd3494

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

convenientbanner/src/main/java/com/bigkoo/convenientbanner/CBLoopViewPager.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,10 @@ public int getCurrentItem() {
125125
}
126126

127127
public void setCurrentItem(int item, boolean smoothScroll) {
128-
int realItem = mAdapter.toInnerPosition(item);
128+
int realItem = 0;
129+
try {
130+
realItem = mAdapter.toInnerPosition(item);
131+
}catch (NullPointerException e){}
129132
super.setCurrentItem(realItem, smoothScroll);
130133
}
131134

0 commit comments

Comments
 (0)