From 577c61d4796a3349b732f31fe257d8f906701f08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Norte?= Date: Thu, 29 Aug 2024 17:17:40 -0700 Subject: [PATCH] Remove unnecessary null check from FabricEventDispatcher Summary: Changelog: [internal] `mReactEventEmitter` is final and initialized with a non-null value in the constructor, so this check is redundant. Reviewed By: sammy-SC Differential Revision: D62004021 --- .../react/uimanager/events/FabricEventDispatcher.java | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/FabricEventDispatcher.java b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/FabricEventDispatcher.java index ce8520ebcaac..73a092651f6b 100644 --- a/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/FabricEventDispatcher.java +++ b/packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/events/FabricEventDispatcher.java @@ -89,16 +89,7 @@ public void dispatchAllEvents() { } private void maybePostFrameCallbackFromNonUI() { - if (mReactEventEmitter != null) { - // If the host activity is paused, the frame callback may not be currently - // posted. Ensure that it is so that this event gets delivered promptly. - mCurrentFrameCallback.maybePostFromNonUI(); - } else { - // No JS application has started yet, or resumed. This can happen when a ReactRootView is - // added to view hierarchy, but ReactContext creation has not completed yet. In this case, any - // touch event dispatch will hit this codepath, and we simply queue them so that they - // are dispatched once ReactContext creation completes and JS app is running. - } + mCurrentFrameCallback.maybePostFromNonUI(); } /** Add a listener to this EventDispatcher. */