diff --git a/DiscordPlayerCountBot/UpdateController.cs b/DiscordPlayerCountBot/UpdateController.cs index c1862f2..36d6e49 100644 --- a/DiscordPlayerCountBot/UpdateController.cs +++ b/DiscordPlayerCountBot/UpdateController.cs @@ -68,13 +68,13 @@ public async Task UpdatePlayerCounts() if (ex is OperationCanceledException canceledException) { Warn($"Discord host connection was closed. Resetting connection.", bot.Information.Id.ToString()); - return; + continue; } if (ex is WebSocketException socketException) { Warn($"Web socket was found to be in a invalid state.", bot.Information.Id.ToString()); - return; + continue; } Error($"Please send crash log to https://discord.gg/FPXdPjcX27.", bot.Information.Id.ToString(), ex); diff --git a/DiscordPlayerCountBot/ViewModels/BaseViewModel.cs b/DiscordPlayerCountBot/ViewModels/BaseViewModel.cs index 92a2d8a..7d48692 100644 --- a/DiscordPlayerCountBot/ViewModels/BaseViewModel.cs +++ b/DiscordPlayerCountBot/ViewModels/BaseViewModel.cs @@ -26,7 +26,7 @@ public string ReplaceTagsWithValues(string? format, bool useNameAsLabel, string } var type = GetType(); - var properties = type.GetProperties().ToList(); + var properties = type.GetProperties(); foreach (var property in properties) { @@ -41,7 +41,7 @@ public string ReplaceTagsWithValues(string? format, bool useNameAsLabel, string continue; } - status = status.Replace(tag, value?.ToString()); + status = status.Replace(tag, value?.ToString() ?? ""); } }