From 7d251e15b340c80e9266c9c3b54447300e9d8d76 Mon Sep 17 00:00:00 2001 From: ziyue <1213642868@qq.com> Date: Thu, 20 Oct 2022 10:59:43 +0800 Subject: [PATCH] =?UTF-8?q?on=5Fpublish=20hook=E5=85=BC=E5=AE=B9=E9=9D=9E?= =?UTF-8?q?=E6=A0=87=E5=87=86=E5=9B=9E=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/WebHook.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/server/WebHook.cpp b/server/WebHook.cpp index a23642fa..8053e7d3 100755 --- a/server/WebHook.cpp +++ b/server/WebHook.cpp @@ -296,7 +296,12 @@ static mINI jsonToMini(const Value &obj) { mINI ret; if (obj.isObject()) { for (auto it = obj.begin(); it != obj.end(); ++it) { - ret[it.name()] = (*it).asString(); + try { + auto str = (*it).asString(); + ret[it.name()] = std::move(str); + } catch (std::exception &) { + WarnL << "Json is not convertible to string, key: " << it.name() << ", value: " << (*it); + } } } return ret;