!517 校正参数校验问题

Merge pull request !517 from 郑志豪/master
This commit is contained in:
openharmony_ci 2024-11-20 02:57:48 +00:00 committed by Gitee
commit 02e5a76852
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -761,8 +761,8 @@ napi_value NapiInnerPrint::NotifyPrintServiceEvent(napi_env env, napi_callback_i
napi_valuetype valuetype;
PRINT_CALL_BASE(env, napi_typeof(env, argv[NapiPrintUtils::INDEX_ZERO], &valuetype), napi_invalid_arg);
PRINT_CALL_BASE(env, napi_typeof(env, argv[NapiPrintUtils::INDEX_ONE], &valuetype), napi_invalid_arg);
std::string jobId = NapiPrintUtils::GetStringFromValueUtf8(env, argv[NapiPrintUtils::INDEX_ZERO]);
uint32_t event = NapiPrintUtils::GetUint32FromValue(env, argv[NapiPrintUtils::INDEX_ONE]);
uint32_t event = NapiPrintUtils::GetUint32FromValue(env, argv[NapiPrintUtils::INDEX_ZERO]);
std::string jobId = NapiPrintUtils::GetStringFromValueUtf8(env, argv[NapiPrintUtils::INDEX_ONE]);
PRINT_HILOGI("jobId: %{public}s, event : %{public}d", jobId.c_str(), event);
if (!IsValidApplicationEvent(event)) {
PRINT_HILOGE("invalid event");