Guard against content view being null in onOverScrolled

Summary:
It seems that the content view can sometimes be null when onOverScrolled is called (presumably when the scrollview gets unmounted while it's in the middle of scrolling?).

Changelog: [Android][fixed] - Guard against content view being null in onOverScrolled.

Reviewed By: mdvacca

Differential Revision: D14737534

fbshipit-source-id: e88ec6f585e50517b734a8809fc3843c0b22df10
This commit is contained in:
Emily Janzer
2019-04-02 18:08:45 -07:00
committed by Facebook Github Bot
parent 71a8944b39
commit 15b2f994ce

View File

@@ -665,7 +665,7 @@ public class ReactScrollView extends ScrollView implements ReactClippingViewGrou
@Override
protected void onOverScrolled(int scrollX, int scrollY, boolean clampedX, boolean clampedY) {
if (mScroller != null) {
if (mScroller != null && mContentView != null) {
// FB SCROLLVIEW CHANGE
// This is part two of the reimplementation of fling to fix the bounce-back bug. See #fling() for