From: Jean-Philippe Orsini Date: Tue, 11 Nov 2014 13:48:59 +0000 (+0100) Subject: ensure that there is at least a value before displaying the unity launcher counter. X-Git-Tag: v1.2.0~54 X-Git-Url: http://wpitchoune.net/gitweb/?p=psensor.git;a=commitdiff_plain;h=0f797f6d418346b5f67064d85e3be767d06a39fd ensure that there is at least a value before displaying the unity launcher counter. --- diff --git a/src/ui_unity.c b/src/ui_unity.c index 0ab2e12..e09bca3 100644 --- a/src/ui_unity.c +++ b/src/ui_unity.c @@ -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); + } } }