Skip to content

Commit

Permalink
added null check.
Browse files Browse the repository at this point in the history
Some implementations of PagerAdapter#isViewFromObject(...) such as FragmentPagerAdapter do not accept null value as object argument(which causes NPE).
  • Loading branch information
zaki50 committed Mar 27, 2013
1 parent 71f4c03 commit e1fe62e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/src/com/jfeinstein/jazzyviewpager/JazzyViewPager.java
Original file line number Diff line number Diff line change
Expand Up @@ -559,6 +559,9 @@ public void setObjectForPosition(Object obj, int position) {

private View findViewFromObject(int position) {
Object o = mObjs.get(Integer.valueOf(position));
if (o == null) {
return null;
}
PagerAdapter a = getAdapter();
View v;
for (int i = 0; i < getChildCount(); i++) {
Expand Down

0 comments on commit e1fe62e

Please sign in to comment.