Skip to content

Commit

Permalink
Fix a crash when reloading the JS bundle
Browse files Browse the repository at this point in the history
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
  • Loading branch information
sammy-SC authored and facebook-github-bot committed Feb 17, 2023
1 parent 0b2bd0f commit 60f381a
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions React/CoreModules/RCTDevSplitBundleLoader.mm
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,12 @@ + (BOOL)requiresMainQueueSetup
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);
}
}];
}
}
Expand Down

0 comments on commit 60f381a

Please sign in to comment.