From 3dd39642bc6dd2ef0ed8d87c678856ac67541860 Mon Sep 17 00:00:00 2001 From: Mikhail Lipin Date: Mon, 30 Sep 2019 16:11:03 -0700 Subject: [PATCH] Adding test changed item for null before announcement changed item details. --- .../src/System/Windows/Forms/PropertyGrid.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/System.Windows.Forms/src/System/Windows/Forms/PropertyGrid.cs b/src/System.Windows.Forms/src/System/Windows/Forms/PropertyGrid.cs index dc7cef3f832..52448610329 100644 --- a/src/System.Windows.Forms/src/System/Windows/Forms/PropertyGrid.cs +++ b/src/System.Windows.Forms/src/System/Windows/Forms/PropertyGrid.cs @@ -3527,6 +3527,11 @@ internal void OnPropertyValueSet(GridItem changedItem, object oldValue) { OnPropertyValueChanged(new PropertyValueChangedEventArgs(changedItem, oldValue)); + if (changedItem == null) + { + return; + } + // Announce the property value change like standalone combobox control do: "[something] selected". bool dropDown = false; Type propertyType = changedItem.PropertyDescriptor.PropertyType;