changeset 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 2f6d27fcdf7d
children 53211cb1e7f5
files include/core/json.h
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
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