From f3c40fb5ec56e5e7788dfce193c01b5ba6f9de77 Mon Sep 17 00:00:00 2001 From: zhengdongdong12 Date: Mon, 29 Jun 2026 16:41:23 +0800 Subject: [PATCH 1/3] =?UTF-8?q?Message:=E4=BB=A3=E7=A0=81=E5=91=8A?= =?UTF-8?q?=E8=AD=A6=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhengdongdong12 --- frameworks/native/ability/native/recovery/app_recovery.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frameworks/native/ability/native/recovery/app_recovery.cpp b/frameworks/native/ability/native/recovery/app_recovery.cpp index 59ce9ccf6f..88a10cdd07 100644 --- a/frameworks/native/ability/native/recovery/app_recovery.cpp +++ b/frameworks/native/ability/native/recovery/app_recovery.cpp @@ -553,7 +553,7 @@ bool AppRecovery::GetMissionIds(std::string path, std::vector &missionI } struct dirent *ptr; while ((ptr = readdir(dir)) != nullptr) { - if (ptr == nullptr) { + if (ptr == nullptr) { // TAG_LOGE(AAFwkTag::RECOVERY, "null ptr"); closedir(dir); return false; @@ -622,7 +622,7 @@ bool AppRecovery::IsEtsAPP() panda::ecmascript::EcmaVM* AppRecovery::GetVMFromAbility(const std::shared_ptr& abilityPtr) { - if (!abilityPtr) { + if (!abilityPtr) { // return nullptr; } OHOS::AbilityRuntime::JsUIAbility& jsAbility = static_cast(*abilityPtr); From 71b6ac4967563b03696d1874f487782a57105dca Mon Sep 17 00:00:00 2001 From: zhengdongdong12 Date: Mon, 29 Jun 2026 16:48:25 +0800 Subject: [PATCH 2/3] =?UTF-8?q?update:=20=E6=9B=B4=E6=96=B0=E6=96=87?= =?UTF-8?q?=E4=BB=B6=20app=5Frecovery.cpp?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhengdongdong12 --- .../ability/native/recovery/app_recovery.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/frameworks/native/ability/native/recovery/app_recovery.cpp b/frameworks/native/ability/native/recovery/app_recovery.cpp index 88a10cdd07..23a7578a56 100644 --- a/frameworks/native/ability/native/recovery/app_recovery.cpp +++ b/frameworks/native/ability/native/recovery/app_recovery.cpp @@ -553,11 +553,6 @@ bool AppRecovery::GetMissionIds(std::string path, std::vector &missionI } struct dirent *ptr; while ((ptr = readdir(dir)) != nullptr) { - if (ptr == nullptr) { // - TAG_LOGE(AAFwkTag::RECOVERY, "null ptr"); - closedir(dir); - return false; - } if (strcmp(ptr->d_name, ".") == 0 || strcmp(ptr->d_name, "..") == 0) { continue; } else if (ptr->d_type == DT_REG) { @@ -622,11 +617,14 @@ bool AppRecovery::IsEtsAPP() panda::ecmascript::EcmaVM* AppRecovery::GetVMFromAbility(const std::shared_ptr& abilityPtr) { - if (!abilityPtr) { // + if (!abilityPtr) { return nullptr; } - OHOS::AbilityRuntime::JsUIAbility& jsAbility = static_cast(*abilityPtr); - AbilityRuntime::JsRuntime& runtime = const_cast(jsAbility.GetJsRuntime()); + auto* jsAbility = dynamic_cast(abilityPtr.get()); + if (!jsAbility) { + return nullptr; + } + AbilityRuntime::JsRuntime& runtime = const_cast(jsAbility->GetJsRuntime()); return runtime.GetEcmaVm(); } From 9b1751b14b89e97b0575383b28f6ee0733ddd27b Mon Sep 17 00:00:00 2001 From: zhengdongdong12 Date: Mon, 29 Jun 2026 17:58:23 +0800 Subject: [PATCH 3/3] =?UTF-8?q?Message:=20=E5=91=8A=E8=AD=A6=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhengdongdong12 --- frameworks/native/ability/native/recovery/app_recovery.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/frameworks/native/ability/native/recovery/app_recovery.cpp b/frameworks/native/ability/native/recovery/app_recovery.cpp index 23a7578a56..1b91aa3cb6 100644 --- a/frameworks/native/ability/native/recovery/app_recovery.cpp +++ b/frameworks/native/ability/native/recovery/app_recovery.cpp @@ -620,11 +620,8 @@ panda::ecmascript::EcmaVM* AppRecovery::GetVMFromAbility(const std::shared_ptr(abilityPtr.get()); - if (!jsAbility) { - return nullptr; - } - AbilityRuntime::JsRuntime& runtime = const_cast(jsAbility->GetJsRuntime()); + OHOS::AbilityRuntime::JsUIAbility& jsAbility = static_cast(*abilityPtr); + AbilityRuntime::JsRuntime& runtime = const_cast(jsAbility.GetJsRuntime()); return runtime.GetEcmaVm(); }