Fix nlohmann::json exception

This commit is contained in:
Eelco Dolstra 2020-02-20 23:47:02 +01:00
parent 73c9840569
commit 4a4521f462

View file

@ -64,7 +64,8 @@ void Registry::write(const Path & path)
nlohmann::json obj; nlohmann::json obj;
obj["from"] = attrsToJson(std::get<0>(elem)->toAttrs()); obj["from"] = attrsToJson(std::get<0>(elem)->toAttrs());
obj["to"] = attrsToJson(std::get<1>(elem)->toAttrs()); obj["to"] = attrsToJson(std::get<1>(elem)->toAttrs());
obj["to"].update(attrsToJson(std::get<2>(elem))); if (!std::get<2>(elem).empty())
obj["to"].update(attrsToJson(std::get<2>(elem)));
arr.emplace_back(std::move(obj)); arr.emplace_back(std::move(obj));
} }