diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewGroup.java b/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewGroup.java index 5e96198a4a6110..d06f1b0395edd7 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewGroup.java +++ b/ReactAndroid/src/main/java/com/facebook/react/views/view/ReactViewGroup.java @@ -7,6 +7,7 @@ package com.facebook.react.views.view; +import android.annotation.TargetApi; import android.content.Context; import android.graphics.Canvas; import android.graphics.Color; @@ -19,6 +20,7 @@ import android.view.MotionEvent; import android.view.View; import android.view.ViewGroup; +import android.view.ViewStructure; import android.view.animation.Animation; import com.facebook.common.logging.FLog; import com.facebook.infer.annotation.Assertions; @@ -43,6 +45,8 @@ import com.facebook.yoga.YogaConstants; import javax.annotation.Nullable; +import static com.facebook.react.common.ReactConstants.TAG; + /** * Backing for a React View. Has support for borders, but since borders aren't common, lazy * initializes most of the storage needed for them. @@ -150,6 +154,16 @@ public void requestLayout() { // `layout` is called on all RN-managed views by `NativeViewHierarchyManager` } + @TargetApi(23) + @Override + public void dispatchProvideStructure(ViewStructure structure) { + try { + super.dispatchProvideStructure(structure); + } catch (NullPointerException e) { + FLog.e(TAG, "NullPointerException when executing dispatchProvideStructure", e); + } + } + @Override public void setBackgroundColor(int color) { if (color == Color.TRANSPARENT && mReactBackgroundDrawable == null) { @@ -673,7 +687,7 @@ protected void dispatchDraw(Canvas canvas) { dispatchOverflowDraw(canvas); super.dispatchDraw(canvas); } catch (NullPointerException e) { - FLog.e(ReactConstants.TAG, "NullPointerException when executing ViewGroup.dispatchDraw method", e); + FLog.e(TAG, "NullPointerException when executing ViewGroup.dispatchDraw method", e); } catch (StackOverflowError e) { // Adding special exception management for StackOverflowError for logging purposes. // This will be removed in the future.