From fa39a961d49bbe231558351ece481ea8fd27d1c4 Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Mon, 4 May 2026 16:15:28 -0400 Subject: [PATCH] Tell users if there are configuration file issues --- NDecrypt/Features/BaseFeature.cs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/NDecrypt/Features/BaseFeature.cs b/NDecrypt/Features/BaseFeature.cs index 2de72a7..56c7349 100644 --- a/NDecrypt/Features/BaseFeature.cs +++ b/NDecrypt/Features/BaseFeature.cs @@ -87,13 +87,27 @@ namespace NDecrypt.Features // Check the configuration path string? configPath = GetString(ConfigName, "config.json"); - if (configPath is null || !File.Exists(configPath)) + if (configPath is null) + { + Console.WriteLine("Configuration path could not be determined, keys will not be read!"); return; + } + + // Get the full configuration path + configPath = Path.GetFullPath(configPath); + if (!File.Exists(configPath)) + { + Console.WriteLine($"Configuration path '{configPath}' does not exist, keys will not be read!"); + return; + } // Try to read the configuration file var config = Configuration.Create(configPath); if (config is null) + { + Console.WriteLine($"Configuration path '{configPath}' is invalid, keys will not be read!"); return; + } // Create the DS tool _tools[FileType.NDS] = new DSProcessor