diff --git a/Penumbra/EphemeralConfig.cs b/Penumbra/EphemeralConfig.cs index b6a06100..bb4a5eb8 100644 --- a/Penumbra/EphemeralConfig.cs +++ b/Penumbra/EphemeralConfig.cs @@ -52,21 +52,23 @@ public class EphemeralConfig : ISavable errorArgs.ErrorContext.Handled = true; } - if (File.Exists(_saveService.FileNames.EphemeralConfigFile)) - try + if (!File.Exists(_saveService.FileNames.EphemeralConfigFile)) + return; + + try + { + var text = File.ReadAllText(_saveService.FileNames.EphemeralConfigFile); + JsonConvert.PopulateObject(text, this, new JsonSerializerSettings { - var text = File.ReadAllText(_saveService.FileNames.EphemeralConfigFile); - JsonConvert.PopulateObject(text, this, new JsonSerializerSettings - { - Error = HandleDeserializationError, - }); - } - catch (Exception ex) - { - Penumbra.Messager.NotificationMessage(ex, - "Error reading ephemeral Configuration, reverting to default.", - "Error reading ephemeral Configuration", NotificationType.Error); - } + Error = HandleDeserializationError, + }); + } + catch (Exception ex) + { + Penumbra.Messager.NotificationMessage(ex, + "Error reading ephemeral Configuration, reverting to default.", + "Error reading ephemeral Configuration", NotificationType.Error); + } } /// Save the current configuration.