ensure that there is at least a value before displaying the unity launcher counter.
[psensor.git] / 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);
+               }
        }
 }