From fb1e52677c3c8c991c9d2aec0d5b6c55e4932d5f Mon Sep 17 00:00:00 2001 From: Siegfried Pammer Date: Sun, 5 Sep 2010 16:29:52 +0200 Subject: [PATCH] fixed NullReference exception in Override Completion Dialogs --- .../Project/Src/Gui/AbstractInlineRefactorDialog.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/AddIns/Misc/SharpRefactoring/Project/Src/Gui/AbstractInlineRefactorDialog.cs b/src/AddIns/Misc/SharpRefactoring/Project/Src/Gui/AbstractInlineRefactorDialog.cs index 8ca00024f0..fded2bf1d1 100644 --- a/src/AddIns/Misc/SharpRefactoring/Project/Src/Gui/AbstractInlineRefactorDialog.cs +++ b/src/AddIns/Misc/SharpRefactoring/Project/Src/Gui/AbstractInlineRefactorDialog.cs @@ -47,7 +47,7 @@ namespace SharpRefactoring.Gui protected abstract string GenerateCode(LanguageProperties language, IClass currentClass); - protected void OKButtonClick(object sender, RoutedEventArgs e) + protected virtual void OKButtonClick(object sender, RoutedEventArgs e) { ParseInformation parseInfo = ParserService.GetParseInformation(editor.FileName); @@ -69,7 +69,7 @@ namespace SharpRefactoring.Gui Deactivate(); } - protected void CancelButtonClick(object sender, RoutedEventArgs e) + protected virtual void CancelButtonClick(object sender, RoutedEventArgs e) { Deactivate(); } @@ -133,7 +133,9 @@ namespace SharpRefactoring.Gui deactivated = true; Element.Remove(); - context.Deactivate(null); + + if (context != null) + context.Deactivate(null); } } }