Browse Source

2003-05-18 Pedro Mart�nez Juli� <[email protected]>

    * FloatingPointFormatter.cs: Fixed NullReferenceException bug I've
    introduced the last change I've done.

svn path=/trunk/mcs/; revision=14654
Pedro Martínez Juliá 22 years ago
parent
commit
6b4fb6fdce

+ 9 - 4
mcs/class/corlib/System/ChangeLog

@@ -1,8 +1,13 @@
-2003-05-17  Ben Maurer <[email protected]>
+2003-05-18  Pedro Martínez Juliá  <[email protected]>
 
-	* Array.cs Fixed SyncRoot to behave like MS (return this). Removed 
-	MonoTODO from SyncRoot (because fixed) and IsSynchronized (it was behaving
-	correctly).
+	* FloatingPointFormatter.cs: Fixed NullReferenceException bug I've
+	introduced the last change I've done.
+
+2003-05-17  Ben Maurer  <[email protected]>
+
+	* Array.cs: Fixed SyncRoot to behave like MS (return this). Removed 
+	MonoTODO from SyncRoot (because fixed) and IsSynchronized (it was
+	behaving correctly).
 	
 2003-05-17  Pedro Martínez Juliá  <[email protected]>
 

+ 6 - 6
mcs/class/corlib/System/FloatingPointFormatter.cs

@@ -45,6 +45,12 @@ namespace System {
 		}
 
 		private string NumberToString () {
+			if (format == null) {
+				format = "G";
+			}
+			if (nfi == null) {
+				nfi = NumberFormatInfo.CurrentInfo;
+			}
 			if (Double.IsNaN(value)) {
 				return nfi.NaNSymbol;
 			}
@@ -54,12 +60,6 @@ namespace System {
 			if (Double.IsPositiveInfinity(value)) {
 				return nfi.PositiveInfinitySymbol;
 			}
-			if (format == null) {
-				format = "G";
-			}
-			if (nfi == null) {
-				nfi = NumberFormatInfo.CurrentInfo;
-			}
 			char specifier;
 			int precision;
 			if (!ParseFormat(out specifier, out precision)) {