diff options
author | iain holmes <iain@xamarin.com> | 2019-07-19 14:44:30 +0300 |
---|---|---|
committer | monojenkins <jo.shields+jenkins@xamarin.com> | 2019-08-02 19:02:34 +0300 |
commit | f3f1a385941f0d854ec1d96e56f24938a246569b (patch) | |
tree | c02169ceb78cf651e3c5901cbc4e8dc2eb2df79f /main | |
parent | d2ffd09000c5d24a206b715b63d409e8e965689a (diff) |
[IDE] Handle bindings returning null commands
KeyBindingManager.Commands can return null, so handle a null return. Wrap the
call to ProcessKeyEventCore in a try catch block to make sure we handle and log
any other possible problems with it.
Fixes VSTS #944669
Diffstat (limited to 'main')
-rw-r--r-- | main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandManager.cs | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandManager.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandManager.cs index 326e5a8299..67aea3f5a5 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandManager.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Commands/CommandManager.cs @@ -478,8 +478,14 @@ namespace MonoDevelop.Components.Commands } #endif // Handle the GDK key via MD commanding - if (ProcessKeyEventCore (ev)) - return true; + try { + if (ProcessKeyEventCore (ev)) { + return true; + } + } catch (Exception ex) { + LoggingService.LogInternalError ("Exception while parsing command", ex); + return false; + } #if MAC // Otherwise if we have a native first responder that is not the GdkQuartzView @@ -547,6 +553,10 @@ namespace MonoDevelop.Components.Commands return false; } + if (commands == null) { + return false; + } + var toplevelFocus = IdeApp.Workbench.HasToplevelFocus; var conflict = new List<Command> (); |