[ReactNative] Fix DevMenu crash when launching the app with WebView executor
This commit is contained in:
parent
08246b77df
commit
3ab4d32538
|
@ -123,11 +123,17 @@ RCT_EXPORT_MODULE()
|
||||||
{
|
{
|
||||||
_settings = [NSMutableDictionary dictionaryWithDictionary:[_defaults objectForKey:RCTDevMenuSettingsKey]];
|
_settings = [NSMutableDictionary dictionaryWithDictionary:[_defaults objectForKey:RCTDevMenuSettingsKey]];
|
||||||
|
|
||||||
|
__weak RCTDevMenu *weakSelf = self;
|
||||||
dispatch_async(dispatch_get_main_queue(), ^{
|
dispatch_async(dispatch_get_main_queue(), ^{
|
||||||
self.shakeToShow = [_settings[@"shakeToShow"] ?: @YES boolValue];
|
RCTDevMenu *strongSelf = weakSelf;
|
||||||
self.profilingEnabled = [_settings[@"profilingEnabled"] ?: @NO boolValue];
|
if (!strongSelf) {
|
||||||
self.liveReloadEnabled = [_settings[@"liveReloadEnabled"] ?: @NO boolValue];
|
return;
|
||||||
self.executorClass = NSClassFromString(_settings[@"executorClass"]);
|
}
|
||||||
|
|
||||||
|
strongSelf.shakeToShow = [strongSelf->_settings[@"shakeToShow"] ?: @YES boolValue];
|
||||||
|
strongSelf.profilingEnabled = [strongSelf->_settings[@"profilingEnabled"] ?: @NO boolValue];
|
||||||
|
strongSelf.liveReloadEnabled = [strongSelf->_settings[@"liveReloadEnabled"] ?: @NO boolValue];
|
||||||
|
strongSelf.executorClass = NSClassFromString(strongSelf->_settings[@"executorClass"]);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue