diff --git a/library/src/com/astuetz/PagerSlidingTabStrip.java b/library/src/com/astuetz/PagerSlidingTabStrip.java index 87b671c..14fe19e 100644 --- a/library/src/com/astuetz/PagerSlidingTabStrip.java +++ b/library/src/com/astuetz/PagerSlidingTabStrip.java @@ -357,8 +357,9 @@ public void onPageScrolled(int position, float positionOffset, int positionOffse currentPosition = position; currentPositionOffset = positionOffset; - - scrollToChild(position, (int) (positionOffset * tabsContainer.getChildAt(position).getWidth())); + if (tabsContainer.getChildAt(position) != null) { + scrollToChild(position, (int) (positionOffset * tabsContainer.getChildAt(position).getWidth())); + } invalidate();