fix rules not serializing properly in tournament state

This commit is contained in:
Martin Michelsen
2023-09-06 23:55:06 -07:00
parent 548aca8cc0
commit c45b4cced7
3 changed files with 14 additions and 15 deletions
+6 -1
View File
@@ -660,7 +660,12 @@ TournamentIndex::TournamentIndex(
return;
}
auto json = JSON::parse(load_file(this->state_filename));
JSON json;
try {
json = JSON::parse(load_file(this->state_filename));
} catch (const cannot_open_file&) {
json = JSON::list();
}
if (json.size() > 0x20) {
throw runtime_error("tournament JSON list length is incorrect");
}