From 3352833035141004450c373220f4389b24ae027e Mon Sep 17 00:00:00 2001 From: Daniel Grunwald Date: Sat, 17 Mar 2012 00:06:13 +0100 Subject: [PATCH] Fix NullReferenceException in WatchList. --- .../Debugger.AddIn/Pads/Controls/WatchList.xaml.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/AddIns/Debugger/Debugger.AddIn/Pads/Controls/WatchList.xaml.cs b/src/AddIns/Debugger/Debugger.AddIn/Pads/Controls/WatchList.xaml.cs index 439410d9ce..07ad0ec678 100644 --- a/src/AddIns/Debugger/Debugger.AddIn/Pads/Controls/WatchList.xaml.cs +++ b/src/AddIns/Debugger/Debugger.AddIn/Pads/Controls/WatchList.xaml.cs @@ -60,8 +60,10 @@ namespace Debugger.AddIn.Pads.Controls } if (e.Key == Key.Enter || e.Key == Key.Escape) { myList.UnselectAll(); - LocalVarPad.Instance.InvalidatePad(); - WatchPad.Instance.InvalidatePad(); + if (LocalVarPad.Instance != null) + LocalVarPad.Instance.InvalidatePad(); + if (WatchPad.Instance != null) + WatchPad.Instance.InvalidatePad(); } } @@ -74,7 +76,7 @@ namespace Debugger.AddIn.Pads.Controls SelectedNode.Node.Name = cell.CommandText; myList.UnselectAll(); - if (WatchType == WatchListType.Watch) { + if (WatchType == WatchListType.Watch && WatchPad.Instance != null) { WatchPad.Instance.InvalidatePad(); } SelectedNode.IsEditing = false;