From 756838ae85b09a1c6c2b550d011043e0979ad8dc Mon Sep 17 00:00:00 2001 From: Markus Hofknecht Date: Sat, 30 Apr 2022 11:51:50 +0200 Subject: [PATCH] [BUG] Fix Exception when PathDirectory empty and click "Change to relative folder" (#376), version 1.2.9.4 --- Properties/AssemblyInfo.cs | 4 ++-- UserInterface/SettingsForm.cs | 11 +++++++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs index ffc000e..b77e8ad 100644 --- a/Properties/AssemblyInfo.cs +++ b/Properties/AssemblyInfo.cs @@ -39,5 +39,5 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.2.9.3")] -[assembly: AssemblyFileVersion("1.2.9.3")] +[assembly: AssemblyVersion("1.2.9.4")] +[assembly: AssemblyFileVersion("1.2.9.4")] diff --git a/UserInterface/SettingsForm.cs b/UserInterface/SettingsForm.cs index e791d7f..9cc381f 100644 --- a/UserInterface/SettingsForm.cs +++ b/UserInterface/SettingsForm.cs @@ -986,10 +986,13 @@ namespace SystemTrayMenu.UserInterface private void ButtonChangeRelativeFolder_Click(object sender, EventArgs e) { - Settings.Default.PathDirectory = Path.GetRelativePath( - Directory.GetParent(Assembly.GetEntryAssembly().Location).FullName, - Config.Path); - textBoxFolder.Text = Config.Path; + if (!string.IsNullOrEmpty(Config.Path)) + { + Settings.Default.PathDirectory = Path.GetRelativePath( + Directory.GetParent(Assembly.GetEntryAssembly().Location).FullName, + Config.Path); + textBoxFolder.Text = Config.Path; + } } private void ButtonOpenAssemblyLocation_Click(object sender, EventArgs e)