修正判断Json::Value::find函数返回值 (#4347)
Some checks failed
Android / build (push) Has been cancelled
CodeQL / Analyze (cpp) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
Docker / build (push) Has been cancelled
Linux / build (push) Has been cancelled
macOS / build (push) Has been cancelled
Windows / build (push) Has been cancelled

修正Json::Value::find函数返回值并非iterator而是Value指针
This commit is contained in:
ljx0305 2025-07-10 14:15:52 +08:00 committed by GitHub
parent 47fd8e9fc3
commit 1ead079af4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -89,11 +89,11 @@ std::string getValue(Args &args, const Key &key) {
template<typename Key>
std::string getValue(Json::Value &args, const Key &key) {
auto it = args.find(key);
if (it == args.end()) {
auto value = args.find(key);
if (value == nullptr) {
return "";
}
return it->second.asString();
return value->asString();
}
template<typename Key>