From acc94de393ed44c69c8a37472c5a684fb189bdf4 Mon Sep 17 00:00:00 2001 From: Vit Horacek Date: Fri, 19 Jul 2024 13:09:11 +0200 Subject: [PATCH] Return early if the hybrid module is not defined --- src/components/HybridAppMiddleware/index.ios.tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/components/HybridAppMiddleware/index.ios.tsx b/src/components/HybridAppMiddleware/index.ios.tsx index c348cc86c974..1ea8e62ab17e 100644 --- a/src/components/HybridAppMiddleware/index.ios.tsx +++ b/src/components/HybridAppMiddleware/index.ios.tsx @@ -59,6 +59,11 @@ function HybridAppMiddleware({children, authenticated}: HybridAppMiddlewareProps return; } + if (!NativeModules.HybridAppModule) { + Log.hmmm(`[HybridApp] Onboarding status has changed, but the HybridAppModule is not defined`); + return; + } + Log.info(`[HybridApp] Onboarding status has changed. Propagating new value to OldDot`, true, {completedHybridAppOnboarding}); NativeModules.HybridAppModule.completeOnboarding(completedHybridAppOnboarding); }, [completedHybridAppOnboarding]);