diff include/core/json.h @ 220:79a87a6dd39d

core/json: fix from_json oops.
author Paper <paper@paper.us.eu.org>
date Mon, 08 Jan 2024 11:56:09 -0500
parents bc1ae1810855
children 862d0d8619f6
line wrap: on
line diff
--- a/include/core/json.h	Sun Jan 07 13:37:50 2024 -0500
+++ b/include/core/json.h	Mon Jan 08 11:56:09 2024 -0500
@@ -19,7 +19,7 @@
 template<typename T>
 void from_json(const nlohmann::json& j, std::optional<T>& v)
 {
-	return j.is_null() ? std::nullopt : j.get<T>();
+	v = j.is_null() ? std::nullopt : j.get<T>();
 }
 
 } // namespace nlohmann