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…
Reference in New Issue