From 79712c35cb3dc255b85c259d19a8133fcbb91894 Mon Sep 17 00:00:00 2001 From: Chad Austin Date: Mon, 5 Nov 2018 10:54:45 -0800 Subject: [PATCH] Disallow Optional::operator=(nullptr_t) unless T is a pointer Summary: The old implementation of folly::none inadvertently allowed disengaging an optional by writing `op = nullptr`. Disallow that and require `op = folly::none`. Reviewed By: yfeldblum Differential Revision: D12884724 fbshipit-source-id: b17bcf00b245069d8ea2d9bc3703b0fdcaa85c07 --- ReactCommon/jsiexecutor/jsireact/JSINativeModules.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ReactCommon/jsiexecutor/jsireact/JSINativeModules.cpp b/ReactCommon/jsiexecutor/jsireact/JSINativeModules.cpp index 952db90c3..aa1a7fdab 100644 --- a/ReactCommon/jsiexecutor/jsireact/JSINativeModules.cpp +++ b/ReactCommon/jsiexecutor/jsireact/JSINativeModules.cpp @@ -45,7 +45,7 @@ Value JSINativeModules::getModule(Runtime& rt, const PropNameID& name) { } void JSINativeModules::reset() { - m_genNativeModuleJS = nullptr; + m_genNativeModuleJS = folly::none; m_objects.clear(); }