Skip to content
Permalink
Browse files

default-applications: Fix assertion failture on g_icon_to_string

Prevent runtime failture on g_icon_to_string in fill_combo_box by catching the NULL case

See #398 (comment)

Signed-off-by: Zhang Xianwei <zhang.xianwei8@zte.com.cn>
  • Loading branch information...
zhangxianwei8 authored and lukefromdc committed Dec 8, 2018
1 parent 08d1e4e commit 9482529f93ce7679fcbb350971ea8678347ab8c5
Showing with 10 additions and 6 deletions.
  1. +10 −6 capplets/default-applications/mate-da-capplet.c
@@ -501,12 +501,16 @@ fill_combo_box(GtkIconTheme* theme, GtkComboBox* combo_box, GList* app_list, gch

/* Icon */
GIcon* icon = g_app_info_get_icon(item);
gchar* icon_name = g_icon_to_string(icon);

if (icon_name == NULL)
{
/* Default icon */
icon_name = g_strdup("binary");
gchar* icon_name;

if (icon != NULL) {
icon_name = g_icon_to_string (icon);
if (icon_name == NULL) {
/* Default icon */
icon_name = g_strdup ("binary");
}
} else {
icon_name = g_strdup ("binary");
}

pixbuf = gtk_icon_theme_load_icon(theme, icon_name, 22, 0, NULL);

0 comments on commit 9482529

Please sign in to comment.
You can’t perform that action at this time.