diff --git a/managed/CounterStrikeSharp.API/Core/CoreConfig.cs b/managed/CounterStrikeSharp.API/Core/CoreConfig.cs index e7a1088ec..7771456bf 100644 --- a/managed/CounterStrikeSharp.API/Core/CoreConfig.cs +++ b/managed/CounterStrikeSharp.API/Core/CoreConfig.cs @@ -151,27 +151,28 @@ public void Load() _commandsRegistered = true; } - if (!File.Exists(_coreConfigPath)) + if (File.Exists(_coreConfigPath)) { - _logger.LogWarning( - "Core configuration could not be found at path \"{CoreConfigPath}\", fallback values will be used.", - _coreConfigPath); - return; - } - - try - { - var data = JsonSerializer.Deserialize(File.ReadAllText(_coreConfigPath), - new JsonSerializerOptions() { ReadCommentHandling = JsonCommentHandling.Skip }); - - if (data != null) + try + { + var data = JsonSerializer.Deserialize(File.ReadAllText(_coreConfigPath), + new JsonSerializerOptions() { ReadCommentHandling = JsonCommentHandling.Skip }); + + if (data != null) + { + _coreConfig = data; + } + } + catch (Exception ex) { - _coreConfig = data; + _logger.LogWarning(ex, "Failed to load core configuration, fallback values will be used"); } } - catch (Exception ex) + else { - _logger.LogWarning(ex, "Failed to load core configuration, fallback values will be used"); + _logger.LogWarning( + "Core configuration could not be found at path \"{CoreConfigPath}\", fallback values will be used.", + _coreConfigPath); } var serverCulture = CultureInfo.GetCultures(CultureTypes.AllCultures)