diff --git a/services/grid-bot/lib/utility/Implementation/AvatarUtility.cs b/services/grid-bot/lib/utility/Implementation/AvatarUtility.cs index 93cb9fbc..5c4b634f 100644 --- a/services/grid-bot/lib/utility/Implementation/AvatarUtility.cs +++ b/services/grid-bot/lib/utility/Implementation/AvatarUtility.cs @@ -189,10 +189,7 @@ private static string DownloadFile(string url) var file = File.OpenWrite(path); using var client = new HttpClient(); - using var stream = client.GetStreamAsync(url).SyncOrDefault(); - - if (stream == null) throw new ThumbnailResponseException(ThumbnailResponseState.Error, "The thumbnail response stream was null"); - + using var stream = client.GetStreamAsync(url).SyncOrDefault() ?? throw new ThumbnailResponseException(ThumbnailResponseState.Error, "The thumbnail response stream was null"); stream.CopyTo(file); file.Close();