Fixed another possible NPE
authorBill Kuker <bkuker@billkuker.com>
Mon, 8 Nov 2010 03:01:07 +0000 (03:01 +0000)
committerBill Kuker <bkuker@billkuker.com>
Mon, 8 Nov 2010 03:01:07 +0000 (03:01 +0000)
src/com/billkuker/rocketry/motorsim/RocketScience.java

index ab77759613fb345e55a57898a028dbb7f0492b49..9caa7baf12f72de32c89999481b5fc340b050ece 100644 (file)
@@ -122,13 +122,15 @@ public class RocketScience {
        }\r
 \r
        public static <T extends Quantity> String ammountToString(Amount<T> a) {\r
+               if ( a == null )\r
+                       return "Null";\r
                final NumberFormat nf = new DecimalFormat("##########.###");\r
                return nf.format(a.doubleValue(a.getUnit())) + " " + a.getUnit();\r
        }\r
        \r
        public static <T extends Quantity> String ammountToRoundedString(Amount<T> a) {\r
                if (a == null)\r
-                       return "NULL";\r
+                       return "Null";\r
                Unit<T> u = RocketScience.UnitPreference.preference.getPreferredUnit(a\r
                                .getUnit());\r
                double d = a.doubleValue(u);\r