Fix for null bsa size

This commit is contained in:
Timothy Baldridge 2020-03-09 15:07:57 -06:00
parent 3ef75a248d
commit d20a2d4bb5

View File

@ -1,4 +1,5 @@
using System; using System;
using System.ComponentModel.DataAnnotations;
using System.Globalization; using System.Globalization;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
@ -237,7 +238,9 @@ namespace Wabbajack.Lib
Status($"Building {bsa.To}"); Status($"Building {bsa.To}");
var sourceDir = Path.Combine(OutputFolder, Consts.BSACreationDir, bsa.TempID); 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 => var streams = await bsa.FileStates.PMap(Queue, state =>
{ {