diff --git a/ReactCommon/cxxreact/ModuleRegistry.cpp b/ReactCommon/cxxreact/ModuleRegistry.cpp index 17f17746984809..041d84c5a187b2 100644 --- a/ReactCommon/cxxreact/ModuleRegistry.cpp +++ b/ReactCommon/cxxreact/ModuleRegistry.cpp @@ -88,13 +88,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; @@ -141,7 +141,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 9cd370e4ac5246..9e72390f875f81 100644 --- a/ReactCommon/jsiexecutor/jsireact/JSINativeModules.cpp +++ b/ReactCommon/jsiexecutor/jsireact/JSINativeModules.cpp @@ -62,7 +62,7 @@ folly::Optional JSINativeModules::createModule( auto result = m_moduleRegistry->getConfig(name); if (!result.hasValue()) { - return nullptr; + return folly::none; } Value moduleInfo = m_genNativeModuleJS->call(