From ab07f65d02f88f53053da3aa60f759c54f4b695b Mon Sep 17 00:00:00 2001 From: lidezhi Date: Tue, 9 Sep 2025 22:06:40 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9C=A8=E8=A7=A3=E6=9E=90=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=89=8D=EF=BC=8C=E5=88=A4=E6=96=AD=E6=98=AF=E5=90=A6=E4=B8=BA?= =?UTF-8?q?object?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: lidezhi Change-Id: I3db539029fa53029a672e276992ddbd89dee3aa3 --- services/context/src/widget_client.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/services/context/src/widget_client.cpp b/services/context/src/widget_client.cpp index 2a7431463..dbb31f2fc 100644 --- a/services/context/src/widget_client.cpp +++ b/services/context/src/widget_client.cpp @@ -68,8 +68,8 @@ ResultCode WidgetClient::OnNotice(NoticeType type, const std::string &eventData) } IAM_LOGI("recv notice eventData: %{public}s", eventData.c_str()); auto root = nlohmann::json::parse(eventData.c_str(), nullptr, false); - if (root.is_null() || root.is_discarded()) { - IAM_LOGE("OnNotice eventData is not json format"); + if (root.is_null() || root.is_discarded() || !root.is_object()) { + IAM_LOGE("OnNotice eventData is not correct json format"); return ResultCode::INVALID_PARAMETERS; } WidgetNotice notice = root.get(); -- Gitee