From d20a2d4bb52d9b0d3ef0cc22b1cf2d6616038241 Mon Sep 17 00:00:00 2001 From: Timothy Baldridge Date: Mon, 9 Mar 2020 15:07:57 -0600 Subject: [PATCH] Fix for null bsa size --- Wabbajack.Lib/MO2Installer.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Wabbajack.Lib/MO2Installer.cs b/Wabbajack.Lib/MO2Installer.cs index 3b3c13b8..acb2238b 100644 --- a/Wabbajack.Lib/MO2Installer.cs +++ b/Wabbajack.Lib/MO2Installer.cs @@ -1,4 +1,5 @@ using System; +using System.ComponentModel.DataAnnotations; using System.Globalization; using System.IO; using System.Linq; @@ -237,7 +238,9 @@ namespace Wabbajack.Lib Status($"Building {bsa.To}"); var sourceDir = Path.Combine(OutputFolder, Consts.BSACreationDir, bsa.TempID); - using (var a = bsa.State.MakeBuilder(bsa.Size)) + var bsaSize = bsa.FileStates.Select(state => File.GetSize(Path.Combine(sourceDir, state.Path))).Sum(); + + using (var a = bsa.State.MakeBuilder(bsaSize)) { var streams = await bsa.FileStates.PMap(Queue, state => {