Browse Source

* ComboBox.cs: Don't touch if null.

svn path=/trunk/mcs/; revision=56740
Jackson Harper 20 years ago
parent
commit
552c714ef7

+ 4 - 0
mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog

@@ -1,3 +1,7 @@
+2006-02-09  Jackson Harper  <[email protected]>
+
+	* ComboBox.cs: Don't touch if null.
+
 2006-02-09  Peter Dennis Bartok  <[email protected]>
 
 	* Cursor.cs: 64bit safeness fix

+ 5 - 3
mcs/class/Managed.Windows.Forms/System.Windows.Forms/ComboBox.cs

@@ -1198,9 +1198,11 @@ namespace System.Windows.Forms
 			
 			if (item == -1)
 				return;
-			
-			listbox_ctrl.SetTopItem (item);
-			listbox_ctrl.SetHighLightedItem (Items[item]);
+
+			if (listbox_ctrl != null) {
+				listbox_ctrl.SetTopItem (item);
+				listbox_ctrl.SetHighLightedItem (Items[item]);
+			}
 		}
 		
 		internal void SetControlText (string s)