Skip to content
This repository has been archived by the owner on Sep 11, 2023. It is now read-only.

Commit

Permalink
improve file rename logic
Browse files Browse the repository at this point in the history
  • Loading branch information
maxijabase committed Sep 23, 2021
1 parent 0b1f402 commit 1cd21d2
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions UI/Windows/RenameWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,7 @@ private bool IsNameTaken(string inputText)

private void CheckExtension()
{
try
{
if (!Program.MainWindow.FileIcons.ContainsKey(TxtName.Text.Substring(TxtName.Text.LastIndexOf('.'))))
if (!TxtName.Text.Contains(".") || !Program.MainWindow.FileIcons.ContainsKey(TxtName.Text.Substring(TxtName.Text.LastIndexOf('.'))))
{
lblError.Content = Program.Translations.GetLanguage("FileNotSupported");
lblError.ToolTip = Program.Translations.GetLanguage("FileWillBeExcluded");
Expand All @@ -122,11 +120,6 @@ private void CheckExtension()
lblError.Content = "";
lblError.ToolTip = "";
}
}
catch (ArgumentOutOfRangeException)
{
// this is ugly and newbish but I'm lazy and it works
}
}

public void Language_Translate()
Expand Down

0 comments on commit 1cd21d2

Please sign in to comment.