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