Skip to content

Commit a39c3e0

Browse files
authored
Fix: Fixed ArgumentException in ContextMenu (#14689)
1 parent d8b2bf7 commit a39c3e0

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/Files.App/Utils/Shell/ContextMenu.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,11 @@ void LoadSubMenu()
265265
{
266266
cMenu2?.HandleMenuMsg((uint)User32.WindowMessage.WM_INITMENUPOPUP, (IntPtr)hSubMenu, new IntPtr(index));
267267
}
268+
catch (Exception ex) when (ex is InvalidCastException or ArgumentException)
269+
{
270+
// TODO: Investigate why this exception happen
271+
Debug.WriteLine(ex);
272+
}
268273
catch (Exception ex) when (ex is COMException or NotImplementedException)
269274
{
270275
// Only for dynamic/owner drawn? (open with, etc)
@@ -295,7 +300,7 @@ public Task<bool> LoadSubMenu(List<Win32ContextMenuItem> subItems)
295300
loadSubMenuAction!();
296301
return true;
297302
}
298-
catch (COMException)
303+
catch
299304
{
300305
return false;
301306
}

0 commit comments

Comments
 (0)