From f3cfec5cb4d3e0f66984c49b202110d20866b5c9 Mon Sep 17 00:00:00 2001 From: Carlos Martins Date: Tue, 26 Nov 2024 13:09:48 -0700 Subject: [PATCH] Merge pull request #53165 from Expensify/vit-53150 [CP Staging] Make sure to check the navBarManager is defined (cherry picked from commit d69518cb52ed3a5f88372468ad47c264087213c6) (CP triggered by mountiny) --- src/libs/NavBarManager/index.android.ts | 6 ++++++ src/libs/Navigation/AppNavigator/AuthScreens.tsx | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/src/libs/NavBarManager/index.android.ts b/src/libs/NavBarManager/index.android.ts index 81a4626bfb08..681387886759 100644 --- a/src/libs/NavBarManager/index.android.ts +++ b/src/libs/NavBarManager/index.android.ts @@ -1,9 +1,15 @@ import {NativeModules} from 'react-native'; +import Log from '@libs/Log'; import type StartupTimer from './types'; import type {NavBarButtonStyle} from './types'; const navBarManager: StartupTimer = { setButtonStyle: (style: NavBarButtonStyle) => { + if (!NativeModules.RNNavBarManager) { + Log.hmmm('RNNavBarManager not found'); + return; + } + NativeModules.RNNavBarManager.setButtonStyle(style); }, }; diff --git a/src/libs/Navigation/AppNavigator/AuthScreens.tsx b/src/libs/Navigation/AppNavigator/AuthScreens.tsx index 92195e12348a..689945da099e 100644 --- a/src/libs/Navigation/AppNavigator/AuthScreens.tsx +++ b/src/libs/Navigation/AppNavigator/AuthScreens.tsx @@ -261,6 +261,10 @@ function AuthScreens({session, lastOpenedPublicRoomID, initialLastUpdateIDApplie }); useEffect(() => { + if (!NavBarManager) { + Log.hmmm('RNNavBarManager not found in AuthScreens'); + return; + } NavBarManager.setButtonStyle(theme.navigationBarButtonsStyle); return () => {