mirror of
https://gitee.com/openharmony/ability_ability_runtime
synced 2024-11-30 10:52:57 +00:00
增加判空
Signed-off-by: fangting <fangting12@huawei.com>
This commit is contained in:
parent
5ea5b99b21
commit
fab55af3ac
@ -736,7 +736,12 @@ bool JsRuntime::Initialize(const Options& options)
|
||||
std::string loadPath = ExtractorUtil::GetLoadFilePath(options.hapPath);
|
||||
bool newCreate = false;
|
||||
std::shared_ptr<Extractor> 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<JsEnv::SourceMapOperator>(options.bundleName, isModular,
|
||||
hasFile);
|
||||
InitSourceMap(operatorObj);
|
||||
|
Loading…
Reference in New Issue
Block a user