mirror of
https://github.com/status-im/react-native.git
synced 2025-01-13 19:15:05 +00:00
Check self.isValid in RCTBatchedBridge after initial script evaluation
Summary: I noticed that sometimes the batched bridge would be valid before `[self enqueueApplicationScript:url:onComplete:]` but then become invalid in the completion callback. This diff checks `self.isValid` inside of the callback. Closes https://github.com/facebook/react-native/pull/2016 Reviewed By: @trunkagent, @jspahrsummers Differential Revision: D2443438 Pulled By: @tadeuzagallo
This commit is contained in:
parent
974ec059e8
commit
7615d74d14
@ -340,6 +340,10 @@ RCT_EXTERN NSArray *RCTGetModuleClasses(void);
|
||||
sourceCodeModule.scriptText = sourceCode;
|
||||
|
||||
[self enqueueApplicationScript:sourceCode url:self.bundleURL onComplete:^(NSError *loadError) {
|
||||
if (!self.isValid) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (loadError) {
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
[self stopLoadingWithError:loadError];
|
||||
|
Loading…
x
Reference in New Issue
Block a user