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
This commit is contained in:
Emily Janzer
2020-12-01 15:02:20 -08:00
committed by Facebook GitHub Bot
parent ae6f4f308e
commit d435d26d87
+1 -1
View File
@@ -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);
}