summaryrefslogtreecommitdiffhomepage
path: root/serialize
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2022-10-26 21:03:44 +0200
committerStanislaw Halik <sthalik@misaki.pl>2022-10-26 21:03:44 +0200
commit0ab3e14ff05969f91ce24867a6ada45e53f6ecf5 (patch)
tree6c76ca5f656bb0eb463cff168812d00b91f9f0e3 /serialize
parent7ebc9669343ba5cf05eb3a5bbff00d12be231622 (diff)
fix serialize tile atlas
Diffstat (limited to 'serialize')
-rw-r--r--serialize/tile.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/serialize/tile.cpp b/serialize/tile.cpp
index 11473548..8a5374ab 100644
--- a/serialize/tile.cpp
+++ b/serialize/tile.cpp
@@ -17,7 +17,7 @@ using namespace floormat;
namespace nlohmann {
void adl_serializer<tile_image>::to_json(json& j, const tile_image& val) { using nlohmann::to_json; if (val.atlas) to_json(j, val); else j = nullptr; }
-void adl_serializer<tile_image>::from_json(const json& j, tile_image& val) { using nlohmann::from_json; from_json(j, val); }
+void adl_serializer<tile_image>::from_json(const json& j, tile_image& val) { using nlohmann::from_json; if (j.is_null()) val = {}; else from_json(j, val); }
void adl_serializer<tile>::to_json(json& j, const tile& val) { using nlohmann::to_json; to_json(j, val); }
void adl_serializer<tile>::from_json(const json& j, tile& val) { using nlohmann::from_json; from_json(j, val); }