[gnome-shell] st/icon: Check icon name for empty string in setter function



commit 8b15519160360ac24b55f2a1f06bdd069b81b375
Author: Jonas Dreßler <verdre v0yd nl>
Date:   Thu Nov 21 19:05:11 2019 +0700

    st/icon: Check icon name for empty string in setter function
    
    Don't try to create a GIcon if the given icon name is empty, it will
    lead to failure when loading the icon anyway, instead set the gicon to
    NULL just as we do in the `set_gicon()` API when unsetting an icon.
    
    https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/888

 src/st/st-icon.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/st/st-icon.c b/src/st/st-icon.c
index 8b8dbc2ff8..aa98ed2236 100644
--- a/src/st/st-icon.c
+++ b/src/st/st-icon.c
@@ -553,7 +553,7 @@ st_icon_set_icon_name (StIcon      *icon,
 
   g_return_if_fail (ST_IS_ICON (icon));
 
-  if (icon_name)
+  if (icon_name && *icon_name)
     gicon = g_themed_icon_new_with_default_fallbacks (icon_name);
 
   g_object_freeze_notify (G_OBJECT (icon));
@@ -730,7 +730,7 @@ st_icon_set_fallback_icon_name (StIcon      *icon,
 
   g_return_if_fail (ST_IS_ICON (icon));
 
-  if (fallback_icon_name != NULL)
+  if (fallback_icon_name && *fallback_icon_name)
     gicon = g_themed_icon_new_with_default_fallbacks (fallback_icon_name);
 
   g_object_freeze_notify (G_OBJECT (icon));


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