!458 打印接口参数校验

Merge pull request !458 from 包泽伟/master
This commit is contained in:
openharmony_ci 2024-10-29 03:58:36 +00:00 committed by Gitee
commit 75ce4c7543
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -48,7 +48,9 @@ napi_value NapiPrintTask::Print(napi_env env, napi_callback_info info)
PRINT_ASSERT_BASE(env, argc == NapiPrintUtils::ARGC_ONE || argc == NapiPrintUtils::ARGC_TWO,
"need 1 or 2 parameter!", napi_invalid_arg);
napi_status checkStatus = VerifyParameters(env, argc, argv, context);
if (checkStatus != napi_ok) {
if (argc == NapiPrintUtils::ARGC_ONE) {
return napi_ok;
} else if (checkStatus != napi_ok) {
return checkStatus;
}