From f08d4ddb73bec838ddd5ba866d955fe46b516a13 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/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/MessageBox/Implementation/MessageBox.cs b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/MessageBox/Implementation/MessageBox.cs index 0834679e..b820aee1 100644 --- a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/MessageBox/Implementation/MessageBox.cs +++ b/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":