From aafd39ead3a94e4cca7db46495c5dcaf817b37dd Mon Sep 17 00:00:00 2001 From: liwang <965027894@qq.com> Date: Fri, 5 Sep 2025 09:49:36 +0800 Subject: [PATCH] =?UTF-8?q?EnumConvertAniToNative=E5=AF=B9env=E8=BF=9B?= =?UTF-8?q?=E8=A1=8C=E5=88=A4=E7=A9=BA=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: liwang <965027894@qq.com> --- frameworks/ets/ani/include/sts_common.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/frameworks/ets/ani/include/sts_common.h b/frameworks/ets/ani/include/sts_common.h index 739c5f1ca..c7d0e0633 100644 --- a/frameworks/ets/ani/include/sts_common.h +++ b/frameworks/ets/ani/include/sts_common.h @@ -131,6 +131,10 @@ static bool CallSetter(ani_env* env, ani_class cls, ani_object &object, const ch template static bool EnumConvertAniToNative(ani_env *env, ani_enum_item enumItem, T &result) { + if (env == nullptr) { + ANS_LOGE("env nullptr"); + return false; + } ani_status status = ANI_ERROR; if constexpr (std::is_enum::value || std::is_integral::value) { ani_int intValue{}; -- Gitee