Merge pull request 'version' (!50) from cuttingedge into master

Reviewed-on: glax/Tranga#50
This commit is contained in:
glax 2023-07-31 01:59:42 +02:00
commit df8538c3b4

View File

@ -15,7 +15,9 @@ public static class Migrator
if (!File.Exists(settingsFilePath))
return;
JsonNode settingsNode = JsonNode.Parse(File.ReadAllText(settingsFilePath))!;
ushort version = settingsNode["version"]!.GetValue<ushort>();
ushort version = settingsNode["version"] is not null
? settingsNode["version"].GetValue<ushort>()
: settingsNode["ts"]["version"].GetValue<ushort>();
logger?.WriteLine("Migrator", $"Migrating {version} -> {CurrentVersion}");
switch (version)
{