diff --git a/src/Files.App/Utils/Shell/ContextMenu.cs b/src/Files.App/Utils/Shell/ContextMenu.cs index cbee47f87dca..505c5d2e7f2d 100644 --- a/src/Files.App/Utils/Shell/ContextMenu.cs +++ b/src/Files.App/Utils/Shell/ContextMenu.cs @@ -265,6 +265,11 @@ void LoadSubMenu() { cMenu2?.HandleMenuMsg((uint)User32.WindowMessage.WM_INITMENUPOPUP, (IntPtr)hSubMenu, new IntPtr(index)); } + catch (Exception ex) when (ex is InvalidCastException or ArgumentException) + { + // TODO: Investigate why this exception happen + Debug.WriteLine(ex); + } catch (Exception ex) when (ex is COMException or NotImplementedException) { // Only for dynamic/owner drawn? (open with, etc) @@ -295,7 +300,7 @@ public Task LoadSubMenu(List subItems) loadSubMenuAction!(); return true; } - catch (COMException) + catch { return false; }