Skip to content

Commit

Permalink
Check if result from native UIManager is null before accessing view c…
Browse files Browse the repository at this point in the history
…onfig

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
  • Loading branch information
Emily Janzer authored and facebook-github-bot committed Dec 1, 2020
1 parent ae6f4f3 commit d435d26
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Libraries/ReactNative/PaperUIManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit d435d26

Please sign in to comment.