[corlib] Convert with incorrect provider type should still return value when possible
[mono.git] / mcs / class / corlib / System / Int32.cs
index d49cc8608631106776f3cbee57a76fadf0819a10..a095ef3f221b55eb2181243ab845ce037668a62d 100644 (file)
@@ -373,7 +373,7 @@ namespace System {
                        NumberFormatInfo nfi = null;
                        if (fp != null) {
                                Type typeNFI = typeof (System.Globalization.NumberFormatInfo);
-                               nfi = (NumberFormatInfo) fp.GetFormat (typeNFI);
+                               nfi = fp.GetFormat (typeNFI) as NumberFormatInfo;
                        }
                        if (nfi == null)
                                nfi = Thread.CurrentThread.CurrentCulture.NumberFormat;