diff --git a/Application/Main.cs b/Application/Main.cs index c37392ce5..b96961fa6 100644 --- a/Application/Main.cs +++ b/Application/Main.cs @@ -68,15 +68,15 @@ namespace IW4MAdmin.Application ITranslationLookup translationLookup = null; try { + // do any needed housekeeping file/folder migrations + ConfigurationMigration.MoveConfigFolder10518(null); + ConfigurationMigration.CheckDirectories(); + var services = ConfigureServices(); serviceProvider = services.BuildServiceProvider(); ServerManager = (ApplicationManager)serviceProvider.GetRequiredService(); translationLookup = serviceProvider.GetRequiredService(); - // do any needed housekeeping file/folder migrations - ConfigurationMigration.MoveConfigFolder10518(null); - ConfigurationMigration.CheckDirectories(); - ServerManager.Logger.WriteInfo(Utilities.CurrentLocalization.LocalizationIndex["MANAGER_VERSION"].FormatExt(Version)); await CheckVersion(translationLookup); @@ -97,7 +97,10 @@ namespace IW4MAdmin.Application if (e is ConfigurationException configException) { - Console.WriteLine(translationLookup[configException.Message].FormatExt(configException.ConfigurationFileName)); + if (translationLookup != null) + { + Console.WriteLine(translationLookup[configException.Message].FormatExt(configException.ConfigurationFileName)); + } foreach (string error in configException.Errors) {