aboutsummaryrefslogtreecommitdiff
path: root/libdbusmenu-gtk
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2012-11-26 15:41:45 -0600
committerCharles Kerr <charles.kerr@canonical.com>2012-11-26 15:41:45 -0600
commit38acb8129e7c436cddda27e4ff5fb02227035240 (patch)
tree1a67d9719c58f2f01b29b10101508701e18899ea /libdbusmenu-gtk
parent5173c9382c31800010736052760089cb694d1319 (diff)
downloadlibdbusmenu-38acb8129e7c436cddda27e4ff5fb02227035240.tar.gz
libdbusmenu-38acb8129e7c436cddda27e4ff5fb02227035240.tar.bz2
libdbusmenu-38acb8129e7c436cddda27e4ff5fb02227035240.zip
confirm that icon_name is non-NULL before passing it to gtk_icon_theme_has_icon()
Diffstat (limited to 'libdbusmenu-gtk')
-rw-r--r--libdbusmenu-gtk/client.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libdbusmenu-gtk/client.c b/libdbusmenu-gtk/client.c
index c33aaf3..aa80a0c 100644
--- a/libdbusmenu-gtk/client.c
+++ b/libdbusmenu-gtk/client.c
@@ -1182,7 +1182,7 @@ image_property_handle (DbusmenuMenuitem * item, const gchar * property, GVariant
if (gtkimage != NULL && (gtk_image_get_storage_type(GTK_IMAGE(gtkimage)) == GTK_IMAGE_ICON_NAME || gtk_image_get_storage_type(GTK_IMAGE(gtkimage)) == GTK_IMAGE_EMPTY)) {
const gchar *icon_name = NULL;
gtk_image_get_icon_name (GTK_IMAGE(gtkimage), &icon_name, NULL);
- if (gtk_icon_theme_has_icon(gtk_icon_theme_get_default(), icon_name)) {
+ if ((icon_name != NULL) && gtk_icon_theme_has_icon(gtk_icon_theme_get_default(), icon_name)) {
return;
}
}
@@ -1203,6 +1203,7 @@ image_property_handle (DbusmenuMenuitem * item, const gchar * property, GVariant
'rtl' depending on what we're doing. */
gchar * finaliconname = g_strdup_printf("%s-%s", iconname,
gtk_widget_get_direction(GTK_WIDGET(gimi)) == GTK_TEXT_DIR_RTL ? "rtl" : "ltr");
+g_message (G_STRLOC" icon_name %p %s", finaliconname, finaliconname);
if (!gtk_icon_theme_has_icon(gtk_icon_theme_get_default(), finaliconname)) {
/* If we don't have that icon, fall back to having one
without the extra bits. */