Skip to content

Commit

Permalink
create fallback contextContainer (#37441)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #37441

Changelog: [Internal]

i just noticed that `[_delegate createContextContainer]` can be null because it returns `shared_ptr`, we should protect against that!

Reviewed By: javache

Differential Revision: D45805196

fbshipit-source-id: 645815812da1718e1025c7e6b2763e698d86b59a
  • Loading branch information
philIip authored and facebook-github-bot committed May 15, 2023
1 parent a6c658f commit 11251c3
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,9 @@ - (void)_start
RCTLogSetBridgelessCallableJSModules(_bridgeModuleDecorator.callableJSModules);

auto contextContainer = [_delegate createContextContainer];
if (!contextContainer) {
contextContainer = std::make_shared<ContextContainer>();
}
contextContainer->insert(
"RCTImageLoader", facebook::react::wrapManagedObject([_turboModuleManager moduleForName:"RCTImageLoader"]));
contextContainer->insert(
Expand Down

0 comments on commit 11251c3

Please sign in to comment.