diff --git a/Wabbajack.Lib/Downloaders/HTTPDownloader.cs b/Wabbajack.Lib/Downloaders/HTTPDownloader.cs index a034da6f..c0471c66 100644 --- a/Wabbajack.Lib/Downloaders/HTTPDownloader.cs +++ b/Wabbajack.Lib/Downloaders/HTTPDownloader.cs @@ -75,8 +75,9 @@ namespace Wabbajack.Lib.Downloaders public async Task DoDownload(Archive a, string destination, bool download) { - if (download && !Directory.Exists(Directory.GetParent(destination).FullName)) - Directory.CreateDirectory(Directory.GetParent(destination).FullName); + var parent = Directory.GetParent(destination); + if (download && !Directory.Exists(parent.FullName)) + Directory.CreateDirectory(parent.FullName); using (var fs = download ? File.OpenWrite(destination) : null) { @@ -120,12 +121,6 @@ namespace Wabbajack.Lib.Downloaders var contentSize = headerVar != null ? long.Parse(headerVar) : 1; - FileInfo fileInfo = new FileInfo(destination); - if (!fileInfo.Directory.Exists) - { - Directory.CreateDirectory(fileInfo.Directory.FullName); - } - using (var webs = stream) { var buffer = new byte[bufferSize];