diff options
-rw-r--r-- | src/indicator-power.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/indicator-power.c b/src/indicator-power.c index 4b3f85c..9a474bd 100644 --- a/src/indicator-power.c +++ b/src/indicator-power.c @@ -512,9 +512,7 @@ get_device_icon (UpDeviceKind kind, guint64 time_sec, const gchar *device_icon) { - GIcon *gicon; - - gicon = g_icon_new_for_string (device_icon, NULL); + GIcon *gicon = NULL; if (kind == UP_DEVICE_KIND_BATTERY && (state == UP_DEVICE_STATE_FULLY_CHARGED || @@ -538,6 +536,9 @@ get_device_icon (UpDeviceKind kind, } } + if (gicon == NULL) + gicon = g_icon_new_for_string (device_icon, NULL); + return gicon; } |