对StartTrace第三个参数进行null校验

Signed-off-by: chenwei <chenwei469@huawei.com>
This commit is contained in:
chenwei
2023-05-11 10:32:29 +08:00
parent 119d1d7505
commit b193c82374
@@ -64,7 +64,10 @@ bool ParseStringParam(const napi_env& env, const napi_value& value, std::string&
char buf[nameMaxSize] = {0};
size_t len = 0;
napi_get_value_string_utf8(env, value, buf, nameMaxSize, &len);
HiLog::Error(LABEL, "buf: %{public}s.", buf);
HiLog::Error(LABEL, "len: %{public}d.", len);
dest = std::string {buf};
HiLog::Error(LABEL, "dest: %{public}s.", dest.c_str());
return true;
}