Additional null check

Added additional null check in getCount() as sometimes mViewPager would not be null but the adapter from mViewPager.getAdapter() would be