From f29f5298ac1ecfde92d282a5e14429a0e50003f6 Mon Sep 17 00:00:00 2001 From: acy Date: Thu, 3 Jul 2025 10:26:25 +0800 Subject: [PATCH] =?UTF-8?q?ANI=20=E5=91=8A=E8=AD=A6=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: acy Change-Id: Id2cf820560da17ac1c6b17b567e2d541376f4065 --- frameworks/native/backup_ext/src/ext_backup_ani_error.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/frameworks/native/backup_ext/src/ext_backup_ani_error.cpp b/frameworks/native/backup_ext/src/ext_backup_ani_error.cpp index bd72c18a9..f49f3557e 100644 --- a/frameworks/native/backup_ext/src/ext_backup_ani_error.cpp +++ b/frameworks/native/backup_ext/src/ext_backup_ani_error.cpp @@ -23,6 +23,10 @@ void AniError::ThrowBusinessError(ani_env *env, errorCode errCode, const std::st static const char *errorClsName = "L@ohos/base/BusinessError;"; HILOGD("Begin ThrowBusinessError."); + if (env == nullptr) { + HILOGE("env is nullptr"); + return; + } ani_class cls {}; if (ANI_OK != env->FindClass(errorClsName, &cls)) { HILOGE("find class BusinessError %{public}s failed", errorClsName); -- Gitee