2008-06-05 Jonathan Pobst <monkey@jpobst.com>
authorJonathan Pobst <monkey@jpobst.com>
Fri, 6 Jun 2008 00:04:45 +0000 (00:04 -0000)
committerJonathan Pobst <monkey@jpobst.com>
Fri, 6 Jun 2008 00:04:45 +0000 (00:04 -0000)
* DataGridViewCell.cs: Ensure we don't pass null to GetConverter.

svn path=/trunk/mcs/; revision=105128

mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
mcs/class/Managed.Windows.Forms/System.Windows.Forms/DataGridViewCell.cs

index 16efbad9f54c53c51a8fdd386631cf399922760c..ebe52133e31852771711c0ad9ec9721622ad155b 100644 (file)
@@ -1,3 +1,7 @@
+2008-06-05  Jonathan Pobst  <monkey@jpobst.com>
+
+       * DataGridViewCell.cs: Ensure we don't pass null to GetConverter.
+
 2008-06-05  Carlos Alberto Cortez <calberto.cortez@gmail.com>
 
        * XplatUIX1..cs: Use IntPtr size instead of int, as wee need to work
index a7291438c169d1e6a99a2985c08d0770898cd4eb..af57a42a41fad9bf496244f96a08dc990fe38602 100644 (file)
@@ -164,8 +164,14 @@ namespace System.Windows.Forms {
                                        
                                DataGridViewCellStyle style = InheritedStyle;
 
-                               TypeConverter source = TypeDescriptor.GetConverter (valueType);
-                               TypeConverter dest = TypeDescriptor.GetConverter (FormattedValueType);
+                               TypeConverter source = null;
+                               TypeConverter dest = null;
+                               
+                               if (ValueType != null)
+                                       source = TypeDescriptor.GetConverter (valueType);
+                                       
+                               if (FormattedValueType != null)
+                                       dest = TypeDescriptor.GetConverter (FormattedValueType);
                                
                                return GetFormattedValue (Value, RowIndex, ref style, source, dest, DataGridViewDataErrorContexts.Formatting);
                        }