diff --git a/ReactCommon/cxxreact/ModuleRegistry.cpp b/ReactCommon/cxxreact/ModuleRegistry.cpp index 0e3044ce5a2..1d3ba722b8d 100644 --- a/ReactCommon/cxxreact/ModuleRegistry.cpp +++ b/ReactCommon/cxxreact/ModuleRegistry.cpp @@ -90,13 +90,13 @@ folly::Optional ModuleRegistry::getConfig(const std::string& name) if (it == modulesByName_.end()) { if (unknownModules_.find(name) != unknownModules_.end()) { - return nullptr; + return folly::none; } if (!moduleNotFoundCallback_ || !moduleNotFoundCallback_(name) || (it = modulesByName_.find(name)) == modulesByName_.end()) { unknownModules_.insert(name); - return nullptr; + return folly::none; } } size_t index = it->second; @@ -143,7 +143,7 @@ folly::Optional ModuleRegistry::getConfig(const std::string& name) if (config.size() == 2 && config[1].empty()) { // no constants or methods - return nullptr; + return folly::none; } else { return ModuleConfig{index, config}; } diff --git a/ReactCommon/jsiexecutor/jsireact/JSINativeModules.cpp b/ReactCommon/jsiexecutor/jsireact/JSINativeModules.cpp index aa1a7fdab8b..a15ceb05ca3 100644 --- a/ReactCommon/jsiexecutor/jsireact/JSINativeModules.cpp +++ b/ReactCommon/jsiexecutor/jsireact/JSINativeModules.cpp @@ -65,7 +65,7 @@ folly::Optional JSINativeModules::createModule( auto result = m_moduleRegistry->getConfig(name); if (!result.hasValue()) { - return nullptr; + return folly::none; } Value moduleInfo = m_genNativeModuleJS->call(