fix startup issue with no config

This commit is contained in:
RaidMax 2023-04-09 09:59:10 -05:00
parent f4ded4cc1f
commit c550d424dd

View File

@ -389,6 +389,13 @@ namespace IW4MAdmin.Application
var masterRestClient = RestClient.For<IMasterApi>(httpClient); var masterRestClient = RestClient.For<IMasterApi>(httpClient);
var translationLookup = Configure.Initialize(Utilities.DefaultLogger, masterRestClient, appConfig); var translationLookup = Configure.Initialize(Utilities.DefaultLogger, masterRestClient, appConfig);
if (appConfig == null)
{
appConfig = (ApplicationConfiguration) new ApplicationConfiguration().Generate();
appConfigHandler.Set(appConfig);
appConfigHandler.Save().GetAwaiter().GetResult();
}
// register override level names // register override level names
foreach (var (key, value) in appConfig.OverridePermissionLevelNames) foreach (var (key, value) in appConfig.OverridePermissionLevelNames)
{ {