Skip to content
Snippets Groups Projects
Commit 5fbee216 authored by Nicolas Werner's avatar Nicolas Werner
Browse files

Fix fallout from ad59110f (key backup restore broke)

parent ec569028
No related branches found
No related tags found
No related merge requests found
...@@ -38,13 +38,18 @@ from_json(const nlohmann::json &obj, ExportedSession &s) ...@@ -38,13 +38,18 @@ from_json(const nlohmann::json &obj, ExportedSession &s)
void void
to_json(nlohmann::json &obj, const ExportedSessionKeys &keys) to_json(nlohmann::json &obj, const ExportedSessionKeys &keys)
{ {
obj["sessions"] = keys.sessions; obj = keys.sessions;
} }
void void
from_json(const nlohmann::json &obj, ExportedSessionKeys &keys) from_json(const nlohmann::json &obj, ExportedSessionKeys &keys)
{ {
keys.sessions = obj.at("sessions").get<std::vector<ExportedSession>>(); try {
keys.sessions = obj.get<std::vector<ExportedSession>>();
// might be the old format.
} catch (const nlohmann::json::exception &) {
keys.sessions = obj.at("sessions").get<std::vector<ExportedSession>>();
}
} }
void void
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment