From dede5b164990a050d19ad84a9a0837b465a62dee Mon Sep 17 00:00:00 2001 From: Laboredih123 <62359847+Laboredih123@users.noreply.github.com> Date: Thu, 23 May 2024 18:49:08 -0700 Subject: [PATCH] Adds error message to missing file arg (#1807) --- DMCompiler/DMCompiler.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/DMCompiler/DMCompiler.cs b/DMCompiler/DMCompiler.cs index ffd2a0f290..b63a7ded5c 100644 --- a/DMCompiler/DMCompiler.cs +++ b/DMCompiler/DMCompiler.cs @@ -101,6 +101,11 @@ public static void AddResourceDirectory(string dir) { // NB: IncludeFile pushes newly seen files to a stack, so push // them in reverse order to process them in forward order. for (var i = files.Count - 1; i >= 0; i--) { + if (!File.Exists(files[i])) { + Console.WriteLine($"'{files[i]}' does not exist"); + return null; + } + string includeDir = Path.GetDirectoryName(files[i]); string fileName = Path.GetFileName(files[i]);