From db2494649e6e8ccb445f6b8b5a5394e1357ddd0e Mon Sep 17 00:00:00 2001 From: Luca Date: Sun, 14 Mar 2021 15:54:22 +0100 Subject: [PATCH] fixed critical bug when no splash screen was found --- .../CompilationSteps/IncludeSplashScreen.cs | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/Wabbajack.Lib/CompilationSteps/IncludeSplashScreen.cs b/Wabbajack.Lib/CompilationSteps/IncludeSplashScreen.cs index fea04988..6d40bd8d 100644 --- a/Wabbajack.Lib/CompilationSteps/IncludeSplashScreen.cs +++ b/Wabbajack.Lib/CompilationSteps/IncludeSplashScreen.cs @@ -13,7 +13,7 @@ namespace Wabbajack.Lib.CompilationSteps private readonly string _splash; private readonly AbsolutePath _sourcePath; - private List _splashPath; + private List _splashPath = new List(); private readonly bool _splashExists; public IncludeSplashScreen(ACompiler compiler) : base(compiler) @@ -21,10 +21,18 @@ namespace Wabbajack.Lib.CompilationSteps _splash = "splash.png"; _sourcePath = compiler.SourcePath; string rootDirectory = (string)_sourcePath; - _splashExists = File.Exists(((String)Directory.EnumerateFiles(rootDirectory, _splash).ToList().First())) ? true : false; + try + { + _splashExists = File.Exists(((String)Directory.EnumerateFiles(rootDirectory, _splash).ToList().First())); - _splashPath = Directory.EnumerateFiles(rootDirectory, _splash).Select(str => (AbsolutePath)str) - .ToList(); + _splashPath.Concat(Directory.EnumerateFiles(rootDirectory, _splash) + .Select(str => (AbsolutePath)str) + .ToList()); + } + catch + { + _splashExists = false; + } }