Skip to content

Commit

Permalink
fix: load config check if Server node is null
Browse files Browse the repository at this point in the history
  • Loading branch information
chsbuffer committed Nov 14, 2020
1 parent 7b9d9a6 commit c2afc1b
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions Netch/Utils/Configuration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ public static void Load()
Global.Settings = settingJObject?.ToObject<Setting>() ?? new Setting();
Global.Settings.Server.Clear();

foreach (JObject server in settingJObject["Server"])
{
var serverResult = ServerHelper.ParseJObject(server);
if (serverResult != null)
Global.Settings.Server.Add(serverResult);
}
if (settingJObject?["Server"] != null)
foreach (JObject server in settingJObject["Server"])
{
var serverResult = ServerHelper.ParseJObject(server);
if (serverResult != null)
Global.Settings.Server.Add(serverResult);
}
}

catch (JsonException)
{
}
Expand Down

0 comments on commit c2afc1b

Please sign in to comment.