From aa7d5545a765397f6bd34af6ae7f01263ff7f411 Mon Sep 17 00:00:00 2001 From: xiekaiming Date: Wed, 11 Oct 2023 20:18:00 +0800 Subject: [PATCH] =?UTF-8?q?=E9=9A=8FX=E6=8E=A5=E5=8F=A3=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E9=80=BB=E8=BE=91=E9=94=99=E8=AF=AF=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: xiekaiming --- interfaces/kits/js/src/config_policy_napi.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/interfaces/kits/js/src/config_policy_napi.cpp b/interfaces/kits/js/src/config_policy_napi.cpp index 7968a04..61da50d 100644 --- a/interfaces/kits/js/src/config_policy_napi.cpp +++ b/interfaces/kits/js/src/config_policy_napi.cpp @@ -130,7 +130,7 @@ napi_value ConfigPolicyNapi::GetOneCfgFileOrAllCfgFilesEx(napi_env env, napi_cal if (argc == ARGS_SIZE_TWO) { if (asyncContext->followMode_ == FOLLOWX_MODE_USER_DEFINED) { return ThrowNapiError(env, PARAM_ERROR, - "Parameter error. The followMode is USER_DEFINE, extra must be set."); + "Parameter error. The followMode is USER_DEFINED, extra must be set."); } } if (argc == ARGS_SIZE_THREE) { @@ -138,12 +138,13 @@ napi_value ConfigPolicyNapi::GetOneCfgFileOrAllCfgFilesEx(napi_env env, napi_cal if (matchFlag) { if (asyncContext->followMode_ == FOLLOWX_MODE_USER_DEFINED) { return ThrowNapiError(env, PARAM_ERROR, - "Parameter error. The followMode is USER_DEFINE, extra must be set."); + "Parameter error. The followMode is USER_DEFINED, extra must be set."); } napi_create_reference(env, argv[ARR_INDEX_TWO], NAPI_RETURN_ONE, &asyncContext->callbackRef_); - } - if (ParseExtra(env, asyncContext->extra_, argv[ARR_INDEX_TWO]) == nullptr) { - return nullptr; + } else { + if (ParseExtra(env, asyncContext->extra_, argv[ARR_INDEX_TWO]) == nullptr) { + return nullptr; + } } } if (argc >= ARGS_SIZE_FOUR) { -- Gitee