From 951d74dd0d7521d35d4e7014630638fa1bbdc5c8 Mon Sep 17 00:00:00 2001 From: xialiangwei <2049500708@qq.com> Date: Wed, 6 May 2026 15:40:27 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dstring=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: xialiangwei <2049500708@qq.com> --- frameworks/c/ability_runtime/src/mo_dispatcher_param_codec.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frameworks/c/ability_runtime/src/mo_dispatcher_param_codec.cpp b/frameworks/c/ability_runtime/src/mo_dispatcher_param_codec.cpp index bc64ce8ac3..dbb6d57b65 100644 --- a/frameworks/c/ability_runtime/src/mo_dispatcher_param_codec.cpp +++ b/frameworks/c/ability_runtime/src/mo_dispatcher_param_codec.cpp @@ -504,7 +504,8 @@ AbilityRuntime_ErrorCode MoDispatcherParamCodec::WriteRawValue(MessageParcel& pa case OH_ABILITY_RUNTIME_MO_DISPATCHER_VT_F64: return CheckWrite(parcel.WriteDouble(value->u.f64Val)); case OH_ABILITY_RUNTIME_MO_DISPATCHER_VT_STRING: - return CheckWrite(parcel.WriteString(value->u.bstrVal == nullptr ? "" : value->u.bstrVal)); + std::string strVal(value->u.bstrVal != nullptr ? value->u.bstrVal : ""); + return CheckWrite(parcel.WriteString(strVal)); case OH_ABILITY_RUNTIME_MO_DISPATCHER_VT_ENUM: return CheckWrite(parcel.WriteInt32(value->u.enumVal)); default: