fix(ios): fix a potential crash due to null pointer (#985)

This commit is contained in:
luomy
2021-09-24 12:40:20 +08:00
committed by GitHub
parent 9941bb4c26
commit fd6bb1a2e6
@@ -422,6 +422,10 @@ HIPPY_EXPORT_METHOD(setContextName:(NSString *)contextName) {
- (void)secondBundleLoadCompleted:(BOOL)success {
std::shared_ptr<hippy::napi::JSCCtx> context = std::static_pointer_cast<hippy::napi::JSCCtx>(self.pScope->GetContext());
HippyAssert(context != nullptr, @"secondBundleLoadCompleted get null context");
if (nullptr == context) {
return;
}
NSString *workFolder = [self.bridge workFolder2];
HippyAssert(workFolder, @"work folder path should not be null");
if (workFolder) {