Skip to content

Commit c906a7c

Browse files
committed
Don't crash when right-clicking on a path that's too long
1 parent ca2234e commit c906a7c

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

WindowsPathEditor/MainWindow.xaml.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,15 @@ private void DoExplore(object sender, ExecutedRoutedEventArgs e)
267267

268268
private void CanExplore(object sender, CanExecuteRoutedEventArgs e)
269269
{
270-
e.CanExecute = GetSelectedEntry(e) != null && Directory.Exists(GetSelectedEntry(e).Path.ActualPath);
270+
e.CanExecute = false;
271+
try
272+
{
273+
e.CanExecute = GetSelectedEntry(e) != null && Directory.Exists(GetSelectedEntry(e).Path.ActualPath);
274+
}
275+
catch (Exception ex)
276+
{
277+
Debug.Print("Exception in CanExplor: {0}", ex);
278+
}
271279
}
272280

273281
private void DoDelete(object sender, ExecutedRoutedEventArgs e)

0 commit comments

Comments
 (0)