From 11a71789d42a2f8d0e1f36c9015e3ecceb75bcf9 Mon Sep 17 00:00:00 2001 From: brianlagunas_cp Date: Tue, 9 Aug 2011 18:21:21 +0000 Subject: [PATCH] MessageBox: fixed issue where it is possible for the button in the click event handler to be null. --- .../MessageBox/Implementation/MessageBox.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Main/Source/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/MessageBox/Implementation/MessageBox.cs b/Main/Source/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/MessageBox/Implementation/MessageBox.cs index 0834679e..b820aee1 100644 --- a/Main/Source/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/MessageBox/Implementation/MessageBox.cs +++ b/Main/Source/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/MessageBox/Implementation/MessageBox.cs @@ -512,6 +512,10 @@ namespace Microsoft.Windows.Controls private void Button_Click(object sender, RoutedEventArgs e) { Button button = e.OriginalSource as Button; + + if (button == null) + return; + switch (button.Name) { case "PART_NoButton":