Skip to content

Commit 604699f

Browse files
committed
Remove Empty Entries for ProgramSuffixes.xaml.cs
1 parent d6ec4b5 commit 604699f

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

Plugins/Flow.Launcher.Plugin.Program/ProgramSuffixes.xaml.cs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using System.Windows;
1+
using System;
2+
using System.Windows;
23

34
namespace Flow.Launcher.Plugin.Program
45
{
@@ -20,18 +21,21 @@ public ProgramSuffixes(PluginInitContext context, Settings settings)
2021

2122
private void ButtonBase_OnClick(object sender, RoutedEventArgs e)
2223
{
23-
if (string.IsNullOrEmpty(tbSuffixes.Text))
24+
var suffixes = tbSuffixes.Text.Split(Settings.SuffixSeperator, StringSplitOptions.RemoveEmptyEntries);
25+
26+
if (suffixes.Length == 0)
2427
{
2528
string warning = context.API.GetTranslation("flowlauncher_plugin_program_suffixes_cannot_empty");
2629
MessageBox.Show(warning);
2730
return;
2831
}
2932

30-
_settings.ProgramSuffixes = tbSuffixes.Text.Split(Settings.SuffixSeperator);
33+
_settings.ProgramSuffixes = suffixes;
34+
3135
string msg = context.API.GetTranslation("flowlauncher_plugin_program_update_file_suffixes");
3236
MessageBox.Show(msg);
3337

3438
DialogResult = true;
3539
}
3640
}
37-
}
41+
}

0 commit comments

Comments
 (0)