fix: handle broken sigs file gracefully

This commit is contained in:
goat 2022-07-15 19:16:48 +02:00
parent 5e31537a0c
commit 1c581d4be3
No known key found for this signature in database
GPG key ID: 7773BB5B43BA52E5

View file

@ -532,7 +532,17 @@ namespace Dalamud.Game
return;
}
this.textCache = JsonConvert.DeserializeObject<ConcurrentDictionary<string, long>>(File.ReadAllText(this.cacheFile.FullName)) ?? new ConcurrentDictionary<string, long>();
try
{
this.textCache =
JsonConvert.DeserializeObject<ConcurrentDictionary<string, long>>(
File.ReadAllText(this.cacheFile.FullName)) ?? new ConcurrentDictionary<string, long>();
}
catch (Exception ex)
{
this.textCache = new ConcurrentDictionary<string, long>();
Log.Error(ex, "Couldn't load cached sigs");
}
}
}
}