From ae6984dff9d9977a1fc5e99e2d113343fb16113e Mon Sep 17 00:00:00 2001 From: Jan Date: Thu, 8 Aug 2024 19:21:09 +0200 Subject: [PATCH] fix: null values not resulting in parsed optional nullopt for json --- src/ObjCommon/Json/JsonExtension.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ObjCommon/Json/JsonExtension.h b/src/ObjCommon/Json/JsonExtension.h index 3b84b35a..897dc4fe 100644 --- a/src/ObjCommon/Json/JsonExtension.h +++ b/src/ObjCommon/Json/JsonExtension.h @@ -18,7 +18,7 @@ namespace nlohmann template void optional_from_json(const nlohmann::json& j, const char* name, std::optional& value) { const auto it = j.find(name); - if (it != j.end()) + if (it != j.end() && !it->is_null()) value = it->get(); else value = std::nullopt;