ensure that there is at least a value before displaying the unity launcher counter.
authorJean-Philippe Orsini <jeanfi@gmail.com>
Tue, 11 Nov 2014 13:48:59 +0000 (14:48 +0100)
committerJean-Philippe Orsini <jeanfi@gmail.com>
Tue, 11 Nov 2014 13:48:59 +0000 (14:48 +0100)
src/ui_unity.c

index 0ab2e12..e09bca3 100644 (file)
@@ -75,9 +75,11 @@ void ui_unity_launcher_entry_update(struct psensor **sensors,
        if (sensors && *sensors) {
                v = get_max_current_value(sensors, SENSOR_TYPE_TEMP);
 
-               if (!use_celsius)
-                       v = celsius_to_fahrenheit(v);
+               if (v != UNKNOWN_DBL_VALUE) {
+                       if (!use_celsius)
+                               v = celsius_to_fahrenheit(v);
 
-               unity_launcher_entry_set_count(psensor_entry, v);
+                       unity_launcher_entry_set_count(psensor_entry, v);
+               }
        }
 }