[gnome-calculator] Fix critical warnings when entering Financial Mode



commit 7d4f515ae0ca66ccc03e7dd1d5b5a2648d5c069c
Author: Michael Catanzaro <mcatanzaro gnome org>
Date:   Thu May 29 09:48:04 2014 -0500

    Fix critical warnings when entering Financial Mode
    
    Currency.number needs to be nullable.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=728826

 src/currency.vala |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/src/currency.vala b/src/currency.vala
index 75e3797..ea3293f 100644
--- a/src/currency.vala
+++ b/src/currency.vala
@@ -381,7 +381,7 @@ public class CurrencyManager : Object
 
         /* Check if we couldn't find out a currency */
         foreach (var c in currencies)
-            if (c.get_value ().is_zero ())
+            if (c.get_value () == null || c.get_value ().is_zero ())
                 warning ("Currency %s is not provided by IMF or ECB", c.name);
 
         debug ("Rates loaded");
@@ -468,7 +468,7 @@ public class CurrencyManager : Object
 
 public class Currency : Object
 {
-    private Number value;
+    private Number? value;
 
     private string _name;
     public string name { owned get { return _name; } }
@@ -491,7 +491,7 @@ public class Currency : Object
         this.value = value;
     }
 
-    public Number get_value ()
+    public Number? get_value ()
     {
         return value;
     }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]