mirror of
https://github.com/status-im/react-native.git
synced 2025-01-27 09:45:04 +00:00
Avoid crash when accessing jsContextRef without an executor
Reviewed By: adamjernst Differential Revision: D5237039 fbshipit-source-id: 6a86da90605b896093e0ef99b0fcf079bf9854bf
This commit is contained in:
parent
ce6fb337a1
commit
c25f356675
@ -81,8 +81,8 @@ RCT_NOT_IMPLEMENTED(- (instancetype)init)
|
|||||||
code:RCTJavaScriptLoaderErrorNoScriptURL
|
code:RCTJavaScriptLoaderErrorNoScriptURL
|
||||||
userInfo:@{NSLocalizedDescriptionKey:
|
userInfo:@{NSLocalizedDescriptionKey:
|
||||||
[NSString stringWithFormat:@"No script URL provided. Make sure the packager is "
|
[NSString stringWithFormat:@"No script URL provided. Make sure the packager is "
|
||||||
@"running or you have embedded a JS bundle in your application bundle."
|
@"running or you have embedded a JS bundle in your application bundle.\n\n"
|
||||||
@"unsanitizedScriptURLString:(%@)", unsanitizedScriptURLString]}];
|
@"unsanitizedScriptURLString = %@", unsanitizedScriptURLString]}];
|
||||||
}
|
}
|
||||||
return nil;
|
return nil;
|
||||||
}
|
}
|
||||||
|
@ -115,7 +115,7 @@ void Instance::setGlobalVariable(std::string propName,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void *Instance::getJavaScriptContext() {
|
void *Instance::getJavaScriptContext() {
|
||||||
return nativeToJsBridge_->getJavaScriptContext();
|
return nativeToJsBridge_ ? nativeToJsBridge_->getJavaScriptContext() : nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Instance::callJSFunction(std::string&& module, std::string&& method, folly::dynamic&& params) {
|
void Instance::callJSFunction(std::string&& module, std::string&& method, folly::dynamic&& params) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user