From 426412bcee2f8c86308696e162c472d832593bc5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BB=BB=E5=9B=BD=E5=86=9B?= Date: Thu, 14 Aug 2025 10:01:09 +0800 Subject: [PATCH] =?UTF-8?q?fix=20dsl=E5=91=8A=E8=AD=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 任国军 --- frameworks/native/runtime/js_worker.cpp | 5 ++++- services/abilitymgr/src/pending_want_record.cpp | 4 +++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/frameworks/native/runtime/js_worker.cpp b/frameworks/native/runtime/js_worker.cpp index 97153c4636a..8b772ae849f 100644 --- a/frameworks/native/runtime/js_worker.cpp +++ b/frameworks/native/runtime/js_worker.cpp @@ -431,7 +431,10 @@ bool AssetHelper::ReadFilePathData(const std::string& filePath, uint8_t** buff, return flag; } } else { - realfilePath = filePath.substr(pos + 1); + if (pos < std::string::npos) { + pos += 1; + } + realfilePath = filePath.substr(pos); TAG_LOGD(AAFwkTag::JSRUNTIME, "realfilePath: %{private}s", realfilePath.c_str()); int32_t apiTargetVersion = static_cast(workerInfo_->apiTargetVersion.GetOriginPointer()); bool apiSatisfy = apiTargetVersion == 0 || apiTargetVersion > API8; diff --git a/services/abilitymgr/src/pending_want_record.cpp b/services/abilitymgr/src/pending_want_record.cpp index dbdf53c834b..aae461f5080 100644 --- a/services/abilitymgr/src/pending_want_record.cpp +++ b/services/abilitymgr/src/pending_want_record.cpp @@ -119,7 +119,9 @@ int32_t PendingWantRecord::ExecuteOperation( break; case static_cast(OperationType::START_ABILITIES): { std::vector allWantsInfos = key_->GetAllWantsInfos(); - allWantsInfos.back().want = want; + if (!allWantsInfos.empty()) { + allWantsInfos.back().want = want; + } res = pendingWantManager->PendingWantStartAbilitys( allWantsInfos, senderInfo.startOptions, senderInfo.callerToken, -1, callerUid_, callerTokenId_); break; -- Gitee