From 1d0c3cabf0ed9e3e47e51ffb497bc072a235efb7 Mon Sep 17 00:00:00 2001 From: zhangzezhong Date: Wed, 30 Jul 2025 19:16:03 +0800 Subject: [PATCH] fixed appcloneIndex issue Signed-off-by: zhangzezhong --- frameworks/ets/ani/ani_common/src/ani_common_util.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frameworks/ets/ani/ani_common/src/ani_common_util.cpp b/frameworks/ets/ani/ani_common/src/ani_common_util.cpp index 86cf40abb8c..1a76532c4db 100644 --- a/frameworks/ets/ani/ani_common/src/ani_common_util.cpp +++ b/frameworks/ets/ani/ani_common/src/ani_common_util.cpp @@ -859,9 +859,9 @@ bool SetProcessInformation(ani_env *env, ani_object object, const AppExecFwk::Ru TAG_LOGE(AAFwkTag::ANI, "bundleType failed status:%{public}d", status); return false; } - status = env->Object_SetPropertyByName_Ref(object, "appCloneIndex", - CreateInt(env, processInfo.appCloneIndex)); - if (status != ANI_OK) { + if (processInfo.appCloneIndex != -1 && + (status = env->Object_SetPropertyByName_Ref( + object, "appCloneIndex", CreateInt(env, processInfo.appCloneIndex))) != ANI_OK) { TAG_LOGE(AAFwkTag::ANI, "appCloneIndex failed status:%{public}d", status); return false; } -- Gitee