From fab55af3acfa70ebbf079865e7eab9b680a0bb5a Mon Sep 17 00:00:00 2001 From: fangting Date: Tue, 5 Nov 2024 10:23:57 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=88=A4=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: fangting --- frameworks/native/runtime/js_runtime.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/frameworks/native/runtime/js_runtime.cpp b/frameworks/native/runtime/js_runtime.cpp index c39841b7775..4fe74d363c6 100644 --- a/frameworks/native/runtime/js_runtime.cpp +++ b/frameworks/native/runtime/js_runtime.cpp @@ -736,7 +736,12 @@ bool JsRuntime::Initialize(const Options& options) std::string loadPath = ExtractorUtil::GetLoadFilePath(options.hapPath); bool newCreate = false; std::shared_ptr extractor = ExtractorUtil::GetExtractor(loadPath, newCreate); - bool hasFile = extractor->HasEntry(MERGE_SOURCE_MAP_PATH); + bool hasFile = false; + if (!extractor) { + TAG_LOGD(AAFwkTag::JSRUNTIME, "Get extractor failed. hapPath[%{private}s]", loadPath.c_str()); + } else { + hasFile = extractor->HasEntry(MERGE_SOURCE_MAP_PATH); + } auto operatorObj = std::make_shared(options.bundleName, isModular, hasFile); InitSourceMap(operatorObj);