Skip to content

Commit 6505412

Browse files
javachefacebook-github-bot
authored andcommittedJan 30, 2024·
Change null-check in DefaultComponentsRegistry (#42731)
Summary: Pull Request resolved: #42731 This matches the behaviour we have for DefaultTurboModuleManagerDelegate, where we handle the lack of this being set gracefully. It's probably worth still logging this, as it may point at an incorrectly configured app. Changelog: [Internal] Reviewed By: cortinico Differential Revision: D53048064 fbshipit-source-id: 3ef10da3a7779a1274a1a1793387cf8cdf36c535
1 parent 2f523f0 commit 6505412

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed
 

‎packages/react-native/ReactAndroid/src/main/jni/react/newarchdefaults/DefaultComponentsRegistry.cpp

+7-6
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,13 @@ std::shared_ptr<const ComponentDescriptorProviderRegistry>
2525
DefaultComponentsRegistry::sharedProviderRegistry() {
2626
auto providerRegistry = CoreComponentsRegistry::sharedProviderRegistry();
2727

28-
react_native_assert(
29-
DefaultComponentsRegistry::registerComponentDescriptorsFromEntryPoint &&
30-
"'registerComponentDescriptorsFromEntryPoint' was not initialized in 'JNI_OnLoad'");
31-
32-
(DefaultComponentsRegistry::registerComponentDescriptorsFromEntryPoint)(
33-
providerRegistry);
28+
if (DefaultComponentsRegistry::registerComponentDescriptorsFromEntryPoint) {
29+
(DefaultComponentsRegistry::registerComponentDescriptorsFromEntryPoint)(
30+
providerRegistry);
31+
} else {
32+
LOG(WARNING)
33+
<< "Custom component descriptors were not configured from JNI_OnLoad";
34+
}
3435

3536
return providerRegistry;
3637
}

0 commit comments

Comments
 (0)
Please sign in to comment.