diff --git a/frameworks/js/napi/user_auth/src/user_auth_param_utils.cpp b/frameworks/js/napi/user_auth/src/user_auth_param_utils.cpp index 900c9d2ef7e51552e5c2c3db639dc5341227addb..9c2e9a0deebf06cc8b79559371696d620b1ef022 100644 --- a/frameworks/js/napi/user_auth/src/user_auth_param_utils.cpp +++ b/frameworks/js/napi/user_auth/src/user_auth_param_utils.cpp @@ -91,6 +91,10 @@ UserAuthResultCode UserAuthParamUtils::InitAuthType(napi_env env, napi_value val napi_value jsValue = nullptr; napi_handle_scope scope = nullptr; napi_open_handle_scope(env, &scope); + if (scope == nullptr) { + IAM_LOGE("scope is invalid"); + continue; + } napi_get_element(env, value, i, &jsValue); if (jsValue == nullptr) { napi_close_handle_scope(env, scope);