diff --git a/src/NzbDrone.Common/Http/HttpClient.cs b/src/NzbDrone.Common/Http/HttpClient.cs index b0c3acb13..55117b0ff 100644 --- a/src/NzbDrone.Common/Http/HttpClient.cs +++ b/src/NzbDrone.Common/Http/HttpClient.cs @@ -322,7 +322,7 @@ namespace NzbDrone.Common.Http _logger.Debug("Downloading [{0}] to [{1}]", url, fileName); var stopWatch = Stopwatch.StartNew(); - using (var fileStream = new FileStream(fileNamePart, FileMode.Create, FileAccess.ReadWrite)) + await using (var fileStream = new FileStream(fileNamePart, FileMode.Create, FileAccess.ReadWrite)) { var request = new HttpRequest(url); request.AllowAutoRedirect = true; diff --git a/src/NzbDrone.Core/Localization/LocalizationService.cs b/src/NzbDrone.Core/Localization/LocalizationService.cs index 632b5215a..a73cdc9bf 100644 --- a/src/NzbDrone.Core/Localization/LocalizationService.cs +++ b/src/NzbDrone.Core/Localization/LocalizationService.cs @@ -179,21 +179,12 @@ namespace NzbDrone.Core.Localization return; } - using (var fs = File.OpenRead(resourcePath)) + await using var fs = File.OpenRead(resourcePath); + var dict = await JsonSerializer.DeserializeAsync>(fs); + + foreach (var key in dict.Keys) { - if (fs != null) - { - var dict = await JsonSerializer.DeserializeAsync>(fs); - - foreach (var key in dict.Keys) - { - dictionary[key] = dict[key]; - } - } - else - { - _logger.Error("Missing translation/culture resource: {0}", resourcePath); - } + dictionary[key] = dict[key]; } }