Fix null pointer error
Summary: Turns out this can be null in some rare circumstances and can cause a crash in the fragment tracker Reviewed By: aigoncharov Differential Revision: D50562123 fbshipit-source-id: 4dfaecfde69359a85b778fc5ff0a4a3a8165a875
This commit is contained in:
committed by
Facebook GitHub Bot
parent
9c36fd5371
commit
21057fba01
@@ -23,6 +23,9 @@ object ViewPagerDescriptor : ChainedDescriptor<ViewPager>() {
|
||||
|
||||
override fun onGetActiveChild(node: ViewPager): Any? {
|
||||
val child = node.getChildAt(node.currentItem)
|
||||
if (child == null) {
|
||||
return null
|
||||
}
|
||||
val fragment = FragmentTracker.getFragment(child)
|
||||
if (fragment != null) {
|
||||
return fragment
|
||||
|
||||
Reference in New Issue
Block a user