mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2026-01-01 14:10:53 +00:00
Assert on invalid json being saved
This commit is contained in:
@@ -115,6 +115,11 @@ namespace ArchiSteamFarm {
|
||||
return;
|
||||
}
|
||||
|
||||
// This call verifies if JSON is alright
|
||||
// We don't wrap it in try catch as it should always be the case
|
||||
// And if it's not, we want to know about it (in a crash) and correc itt in future version
|
||||
JsonConvert.DeserializeObject<BotDatabase>(json);
|
||||
|
||||
lock (FileLock) {
|
||||
for (byte i = 0; i < 5; i++) {
|
||||
try {
|
||||
|
||||
@@ -116,6 +116,11 @@ namespace ArchiSteamFarm {
|
||||
return;
|
||||
}
|
||||
|
||||
// This call verifies if JSON is alright
|
||||
// We don't wrap it in try catch as it should always be the case
|
||||
// And if it's not, we want to know about it (in a crash) and correc itt in future version
|
||||
JsonConvert.DeserializeObject<GlobalDatabase>(json);
|
||||
|
||||
lock (FileLock) {
|
||||
for (byte i = 0; i < 5; i++) {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user