diff options
Diffstat (limited to 'main/src')
-rw-r--r-- | main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ObjectValue/ObjectValueTreeViewController.cs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ObjectValue/ObjectValueTreeViewController.cs b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ObjectValue/ObjectValueTreeViewController.cs index 30801ce85c..13ebca43b2 100644 --- a/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ObjectValue/ObjectValueTreeViewController.cs +++ b/main/src/addins/MonoDevelop.Debugger/MonoDevelop.Debugger/ObjectValue/ObjectValueTreeViewController.cs @@ -299,12 +299,18 @@ namespace MonoDevelop.Debugger void RemoveValue (ObjectValueNode node) { var toplevel = node.Parent is RootObjectValueNode; - int index = node.Parent.Children.IndexOf (node); + int index; + + if (node.Parent != null) { + index = node.Parent.Children.IndexOf (node); + } else { + index = -1; + } UnregisterNode (node); OnEvaluationCompleted (node, new ObjectValueNode[0]); - if (AllowWatchExpressions && toplevel) + if (AllowWatchExpressions && toplevel && index != -1) ExpressionRemoved?.Invoke (this, new ExpressionRemovedEventArgs (index, node.Name)); } |