This commit is contained in:
JustArchi
2019-04-04 22:34:58 +02:00
parent 44c5bf4ad5
commit 3e4a08d81c
4 changed files with 38 additions and 4 deletions

View File

@@ -315,7 +315,15 @@ namespace ArchiSteamFarm {
BotConfig botConfig;
try {
botConfig = JsonConvert.DeserializeObject<BotConfig>(await RuntimeCompatibility.File.ReadAllTextAsync(filePath).ConfigureAwait(false));
string json = await RuntimeCompatibility.File.ReadAllTextAsync(filePath).ConfigureAwait(false);
if (string.IsNullOrEmpty(json)) {
ASF.ArchiLogger.LogGenericError(string.Format(Strings.ErrorIsEmpty, nameof(json)));
return null;
}
botConfig = JsonConvert.DeserializeObject<BotConfig>(json);
} catch (Exception e) {
ASF.ArchiLogger.LogGenericException(e);