mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-04-19 15:52:53 +00:00
fix: null values not resulting in parsed optional nullopt for json
This commit is contained in:
parent
219590898f
commit
ae6984dff9
@ -18,7 +18,7 @@ namespace nlohmann
|
||||
template<class T> void optional_from_json(const nlohmann::json& j, const char* name, std::optional<T>& value)
|
||||
{
|
||||
const auto it = j.find(name);
|
||||
if (it != j.end())
|
||||
if (it != j.end() && !it->is_null())
|
||||
value = it->get<T>();
|
||||
else
|
||||
value = std::nullopt;
|
||||
|
Loading…
x
Reference in New Issue
Block a user