on_publish hook兼容非标准回复

This commit is contained in:
ziyue 2022-10-20 10:59:43 +08:00
parent 5bc0f306b7
commit 7d251e15b3

View File

@ -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;