From 3d85cd47c2a6103c4e889e03d0ec55bf6fae2ffa Mon Sep 17 00:00:00 2001 From: Hein Rutjes Date: Fri, 3 Apr 2020 14:34:01 +0200 Subject: [PATCH] Fix crash when enabling Performance Monitor on iOS 13.4 --- React/CoreModules/RCTPerfMonitor.mm | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/React/CoreModules/RCTPerfMonitor.mm b/React/CoreModules/RCTPerfMonitor.mm index 68116fd10ef9ad..790591d3afcacd 100644 --- a/React/CoreModules/RCTPerfMonitor.mm +++ b/React/CoreModules/RCTPerfMonitor.mm @@ -44,6 +44,14 @@ static BOOL RCTJSCSetOption(const char *option) static RCTJSCSetOptionType setOption; static dispatch_once_t onceToken; + // As of iOS 13.4, it is no longer possible to change the JavaScriptCore + // options at runtime. The options are protected and will cause an + // exception when you try to change them after the VM has been initialized. + // https://github.com/facebook/react-native/issues/28414 + if (@available(iOS 13.4, *)) { + return NO; + } + dispatch_once(&onceToken, ^{ /** * JSC private C++ static method to toggle options at runtime