From d435d26d87d69afcaf1d89d8a92f91c84aff2d71 Mon Sep 17 00:00:00 2001 From: Emily Janzer Date: Tue, 1 Dec 2020 15:00:04 -0800 Subject: [PATCH] Check if result from native UIManager is null before accessing view config Summary: As titled - attempt to mitigate a JS error on iOS while we work on getting JS view configs. It seems like this happens when the bridge is invalid. Changelog: [Fixed][iOS] Don't throw an error if the UIManager returns null when fetching a view config Reviewed By: kacieb Differential Revision: D25247203 fbshipit-source-id: e2003f99b818f9657c60ff95b266be74fe18a94b --- Libraries/ReactNative/PaperUIManager.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Libraries/ReactNative/PaperUIManager.js b/Libraries/ReactNative/PaperUIManager.js index 776fa431e82..35f456809da 100644 --- a/Libraries/ReactNative/PaperUIManager.js +++ b/Libraries/ReactNative/PaperUIManager.js @@ -71,7 +71,7 @@ const UIManagerJS = { ) { const result = NativeUIManager.lazilyLoadView(viewManagerName); triedLoadingConfig.add(viewManagerName); - if (result.viewConfig) { + if (result != null && result.viewConfig != null) { getConstants()[viewManagerName] = result.viewConfig; lazifyViewManagerConfig(viewManagerName); }