mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Fix a crash when reloading the JS bundle
Summary: changelog: [iOS][Fixed] Fix a crash when reloading JS bundle Do not crash if self is nil. Reviewed By: blakef Differential Revision: D43352039 fbshipit-source-id: dd53677ca152d4021e43ed8d0f1b51c071ca3365
This commit is contained in:
committed by
Facebook GitHub Bot
parent
0b2bd0f62c
commit
60f381a8b9
@@ -63,10 +63,12 @@ RCT_EXPORT_METHOD(loadBundle
|
||||
return;
|
||||
}
|
||||
__typeof(self) strongSelf = weakSelf;
|
||||
strongSelf->_loadScript(source);
|
||||
RCTDevSettings *devSettings = [strongSelf->_moduleRegistry moduleForName:"RCTDevSettings"];
|
||||
[devSettings setupHMRClientWithAdditionalBundleURL:source.url];
|
||||
resolve(@YES);
|
||||
if (strongSelf) {
|
||||
strongSelf->_loadScript(source);
|
||||
RCTDevSettings *devSettings = [strongSelf->_moduleRegistry moduleForName:"RCTDevSettings"];
|
||||
[devSettings setupHMRClientWithAdditionalBundleURL:source.url];
|
||||
resolve(@YES);
|
||||
}
|
||||
}];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user