diff --git a/ReactCommon/cxxreact/Instance.cpp b/ReactCommon/cxxreact/Instance.cpp index d5b4af5e515..2f2dc5d448d 100644 --- a/ReactCommon/cxxreact/Instance.cpp +++ b/ReactCommon/cxxreact/Instance.cpp @@ -222,7 +222,11 @@ ModuleRegistry &Instance::getModuleRegistry() { } void Instance::handleMemoryPressure(int pressureLevel) { - nativeToJsBridge_->handleMemoryPressure(pressureLevel); + if (nativeToJsBridge_) { + // This class resets `nativeToJsBridge_` only in the destructor, + // hence a race is not possible there. + nativeToJsBridge_->handleMemoryPressure(pressureLevel); + } } std::shared_ptr Instance::getJSCallInvoker() {