From 15b2f994ce9d15b2b742d2c89b31dff12bddaeea Mon Sep 17 00:00:00 2001 From: Emily Janzer Date: Tue, 2 Apr 2019 18:08:45 -0700 Subject: [PATCH] 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 --- .../java/com/facebook/react/views/scroll/ReactScrollView.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollView.java b/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollView.java index e6ef83137fb..fffdf27704b 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollView.java +++ b/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollView.java @@ -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