mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Only create TurboModule jsi::HostObject if Java module is non-null
Summary: ## Summary If the Java instance of a TurboModule is null, then the resultant JS object returned from `TurboModuleRegistry` should also be null. Reviewed By: mdvacca Differential Revision: D15253476 fbshipit-source-id: 83a6b9aa97b547aeecf9b285986ad0f5b9e413da
This commit is contained in:
committed by
Facebook Github Bot
parent
e1102b43ff
commit
37583bd6e8
+6
-1
@@ -62,7 +62,12 @@ void TurboModuleManager::installJSIBindings() {
|
||||
}
|
||||
|
||||
const auto moduleInstance = getJavaModule(name);
|
||||
return turboModuleManagerDelegate_->cthis()->getTurboModule(name, moduleInstance, jsCallInvoker_);
|
||||
|
||||
if (moduleInstance) {
|
||||
return turboModuleManagerDelegate_->cthis()->getTurboModule(name, moduleInstance, jsCallInvoker_);
|
||||
}
|
||||
|
||||
return std::shared_ptr<TurboModule>(nullptr);
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user