From b67e815022416cc30b8aae926ef9216a08eecfa7 Mon Sep 17 00:00:00 2001 From: Garulf <535299+Garulf@users.noreply.github.com> Date: Sat, 18 Nov 2023 18:44:01 -0500 Subject: [PATCH] Load template file only if exists --- Flow.Launcher.Core/Plugin/JsonRPCPluginBase.cs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/Flow.Launcher.Core/Plugin/JsonRPCPluginBase.cs b/Flow.Launcher.Core/Plugin/JsonRPCPluginBase.cs index 197932f04..c6b56c81d 100644 --- a/Flow.Launcher.Core/Plugin/JsonRPCPluginBase.cs +++ b/Flow.Launcher.Core/Plugin/JsonRPCPluginBase.cs @@ -126,12 +126,15 @@ namespace Flow.Launcher.Core.Plugin private async Task InitSettingAsync() { + JsonRpcConfigurationModel configuration = null; + if (File.Exists(SettingConfigurationPath)) + { + var deserializer = new DeserializerBuilder().WithNamingConvention(CamelCaseNamingConvention.Instance).Build(); + configuration = + deserializer.Deserialize( + await File.ReadAllTextAsync(SettingConfigurationPath)); + } - var deserializer = new DeserializerBuilder().WithNamingConvention(CamelCaseNamingConvention.Instance) - .Build(); - var configuration = - deserializer.Deserialize( - await File.ReadAllTextAsync(SettingConfigurationPath)); Settings ??= new JsonRPCPluginSettings {