[mono]bugfix:663287 - Validate the type of value against underlyingtype
authorVeerapuram Varadhan <vvaradhan@gmail.com>
Wed, 4 May 2011 18:57:42 +0000 (00:27 +0530)
committerVeerapuram Varadhan <vvaradhan@gmail.com>
Wed, 4 May 2011 21:59:53 +0000 (03:29 +0530)
instead of nullableType.

mcs/class/System/System.ComponentModel/ChangeLog
mcs/class/System/System.ComponentModel/NullableConverter.cs

index c4c7010de63587331023f8e3c0a06c37c149efb9..ff6b0f69c3ec9d997c3f41990427b704e93bb955 100644 (file)
@@ -1,3 +1,9 @@
+2011-05-05  Veerapuram Varadhan  <v.varadhan@gmail.com>
+
+       ** Fixes #663287
+       * NullableConverter.cs (ConvertTo): Compare the type of value
+       against underlyingType instead of nullableType.
+       
 2010-07-19  Marek Habersack  <mhabersack@novell.com>
 
        * MultilineStringConverter.cs: implemented
index 446f1cb590cf1f642d122f7c4082a14b226220ef..3bc6d3805a651c78ec853dbd87cc6f565c11daac 100644 (file)
@@ -102,7 +102,7 @@ namespace System.ComponentModel
 
                        // Explicit cast operator in Nullable when the user casts will take care 
                        // of extracting the inner value.
-                       if (destinationType == underlyingType && value.GetType() == nullableType)
+                       if (destinationType == underlyingType && value.GetType() == underlyingType)
                                return value;
 
                        if (underlyingTypeConverter != null && value != null)