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
diff options
context:
space:
mode:
authorJose Medrano <jose.medrano@microsoft.com>2019-05-31 18:34:49 +0300
committerJose Medrano <jose.medrano@microsoft.com>2019-05-31 18:34:49 +0300
commitbb27e8e2f233dd82db9ab92d5d677c9bf14f2ded (patch)
treef766d7ecd8dbd0069ffd61245e3b5c2555d2894e
parentc1f7151eb8913a9331647efa7a8dcc640f07b96f (diff)
[Watson] Adds try/catch block in DockInPlaceholder
Fixes VSTS #861013 - [Watson] System.NullReferenceException in MonoDevelop.Components.Docking.DockContainer::DockInPlaceholder (MonoDevelop.Ide.dll)
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockContainer.cs40
1 files changed, 22 insertions, 18 deletions
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockContainer.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockContainer.cs
index 39b63f339e..501b4222b7 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockContainer.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Components.Docking/DockContainer.cs
@@ -457,24 +457,28 @@ namespace MonoDevelop.Components.Docking
{
if (placeholderWindow == null || !placeholderWindow.Visible)
return;
-
- if (placeholderWindow.AllowDocking && placeholderWindow.DockDelegate != null) {
- item.Status = DockItemStatus.Dockable;
- DockGroupItem dummyItem = new DockGroupItem (frame, new DockItem (frame, "__dummy"));
- DockGroupItem gitem = layout.FindDockGroupItem (item.Id);
- gitem.ParentGroup.ReplaceItem (gitem, dummyItem);
- placeholderWindow.DockDelegate (item);
- dummyItem.ParentGroup.Remove (dummyItem);
- RelayoutWidgets ();
- } else {
- int px, py;
- GetPointer (out px, out py);
- DockGroupItem gi = FindDockGroupItem (item.Id);
- int pw, ph;
- placeholderWindow.GetPosition (out px, out py);
- placeholderWindow.GetSize (out pw, out ph);
- gi.FloatRect = new Rectangle (px, py, pw, ph);
- item.Status = DockItemStatus.Floating;
+
+ try {
+ if (placeholderWindow.AllowDocking && placeholderWindow.DockDelegate != null) {
+ item.Status = DockItemStatus.Dockable;
+ DockGroupItem dummyItem = new DockGroupItem (frame, new DockItem (frame, "__dummy"));
+ DockGroupItem gitem = layout.FindDockGroupItem (item.Id);
+ gitem.ParentGroup.ReplaceItem (gitem, dummyItem);
+ placeholderWindow.DockDelegate (item);
+ dummyItem.ParentGroup.Remove (dummyItem);
+ RelayoutWidgets ();
+ } else {
+ int px, py;
+ GetPointer (out px, out py);
+ DockGroupItem gi = FindDockGroupItem (item.Id);
+ int pw, ph;
+ placeholderWindow.GetPosition (out px, out py);
+ placeholderWindow.GetSize (out pw, out ph);
+ gi.FloatRect = new Rectangle (px, py, pw, ph);
+ item.Status = DockItemStatus.Floating;
+ }
+ } catch (Exception ex) {
+ LoggingService.LogInternalError ("Updating the dock container placeholder failed", ex);
}
}