Skip to content

Commit

Permalink
default-applications: Fix assertion failture on g_icon_to_string
Browse files Browse the repository at this point in the history
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 10, 2018
1 parent 08d1e4e commit 9482529
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions capplets/default-applications/mate-da-capplet.c
Expand Up @@ -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);
Expand Down

0 comments on commit 9482529

Please sign in to comment.