From c6d990eb0cc685a7928d0b7afd6993e5c7c7b73c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BB=96=E5=BA=B7=E5=BA=B7?= Date: Thu, 1 Jun 2023 09:58:06 +0800 Subject: [PATCH] =?UTF-8?q?fixed=209a2fd07=20from=20https://gitee.com/liao?= =?UTF-8?q?kk/notification=5Fdistributed=5Fnotification=5Fservice/pulls/10?= =?UTF-8?q?11=20napi=20=E5=BC=82=E5=B8=B8=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 廖康康 --- frameworks/js/napi/src/reminder/reminder_common.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/frameworks/js/napi/src/reminder/reminder_common.cpp b/frameworks/js/napi/src/reminder/reminder_common.cpp index 2b127792c..0ba8b8459 100644 --- a/frameworks/js/napi/src/reminder/reminder_common.cpp +++ b/frameworks/js/napi/src/reminder/reminder_common.cpp @@ -383,14 +383,14 @@ bool ReminderCommon::GetPropertyValIfExist(const napi_env &env, const napi_value propertyVal = value; } else { bool hasProperty = false; - NAPI_CALL_BASE(env, napi_has_named_property(env, value, propertyName, &hasProperty), false); - if (!hasProperty) { + napi_status status = napi_has_named_property(env, value, propertyName, &hasProperty); + if (status != napi_ok || !hasProperty) { return false; } napi_get_named_property(env, value, propertyName, &propertyVal); } - NAPI_CALL_BASE(env, napi_typeof(env, propertyVal, &valuetype), false); - if (valuetype != napi_number) { + napi_status status = napi_typeof(env, propertyVal, &valuetype); + if (status != napi_ok || valuetype != napi_number) { if (propertyName == nullptr) { ANSR_LOGW("Wrong argument type. number expected."); } else { -- Gitee