Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/monodevelop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
authorAnže Vodovnik <anvod@microsoft.com>2019-11-29 18:19:09 +0300
committerAnže Vodovnik <anvod@microsoft.com>2019-11-29 18:24:05 +0300
commit2d98672f2a0c76c15045dcc746e34625a6c6259d (patch)
tree5bfb6b42f0ee713096325a8d36bb28ef88cbbdc9 /main
parent85b19cd80e4214981d45206853a41cbb3205fb5d (diff)
Fixes 1026106 - in some cases, NSEvent seems to have been null.
This introduces a null check, and also introduces additional debug level checks for others, just to make sure if we do run into this while debugging, that we are aware.
Diffstat (limited to 'main')
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ContextMenuExtensionsMac.cs15
1 files changed, 15 insertions, 0 deletions
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ContextMenuExtensionsMac.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ContextMenuExtensionsMac.cs
index 49d92992b6..30cbd813b6 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ContextMenuExtensionsMac.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components/ContextMenuExtensionsMac.cs
@@ -29,6 +29,7 @@ using System;
using AppKit;
using CoreGraphics;
using Foundation;
+using MonoDevelop.Core;
using MonoDevelop.Ide;
#endif
@@ -136,6 +137,20 @@ namespace MonoDevelop.Components
0, 0,
parent.Window.WindowNumber,
null, 0, 0, 0);
+
+ // the following lines are here to dianose & fix VSTS 1026106 - we were getting
+ // a SigSegv from here and it is likely caused by NSEven being null, however
+ // it's worth leaving Debug checks in just to be on the safe side
+ if (tmp_event == null) {
+ // since this is often called outside of a try/catch loop, we'll just
+ // log an error and not throw the exception
+ LoggingService.LogInternalError (new ArgumentNullException ("tmp_event"));
+ return;
+ }
+
+ System.Diagnostics.Debug.Assert (parent != null, "Parent was modified (set to null) during execution.");
+ System.Diagnostics.Debug.Assert (menu != null, "Menu was modified (set to null) during execution.");
+
NSMenu.PopUpContextMenu (menu, tmp_event, parent);
}
}