Skip to content

Commit

Permalink
Fixed crashing if cancel is pressed while selecting a file
Browse files Browse the repository at this point in the history
  • Loading branch information
fuomag9 committed Mar 4, 2019
1 parent 2dc9fcd commit 24f724d
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions Video2x/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,18 @@ public MainWindow()

private void Button_Click(object sender, RoutedEventArgs e)
{
var dialog = new CommonOpenFileDialog();
CommonFileDialogResult result = dialog.ShowDialog();
textbox_folder.Text = dialog.FileName;
try
{
var dialog = new CommonOpenFileDialog();
CommonFileDialogResult result = dialog.ShowDialog();
textbox_folder.Text = dialog.FileName;
}
catch (System.InvalidOperationException)
{
//MessageBox.Show("Non è stato selezionato nessun video");
//System.Diagnostics.Debug.WriteLine(textbox_folder.Text);
}

}

private void Save_button_Click(object sender, RoutedEventArgs e)
Expand Down

0 comments on commit 24f724d

Please sign in to comment.