Bugfix for cppcrash

1.Fixed sourcemap not initializing due to different hap packages generated by different IDE templates

Issue: IA8FF1
Signed-off-by: shaoyijiang <shaoyijiang@huawei.com>
Change-Id: I5e6c78c92406116160511f480f118a7956a76a0c
This commit is contained in:
shaoyijiang 2024-06-26 14:23:19 +08:00
parent 3223bf5f4d
commit 92bcd3b4bd

View File

@ -1520,10 +1520,16 @@ bool JSSymbolExtractor::ParseHapFileData([[maybe_unused]] std::string& hapName)
ret = true;
break;
}
} else if (fileName.rfind("sourceMaps.map") != std::string::npos) {
CreateSourceMap(hapName);
}
}
if (ret) {
std::string filePath = "ets/sourceMaps.map";
if (entrys.find(filePath) == entrys.end()) {
LOG_ECMA(INFO) << "Can't find sourceMaps.map in hap/hsp";
return ret;
}
CreateSourceMap(hapName);
}
#endif
return ret;
}