added null check.
Some implementations of PagerAdapter#isViewFromObject(...) such as FragmentPagerAdapter do not accept null value as object argument(which causes NPE).