From 52c3c220ba80e6aaf3f9c04e5c826fb4eb22191e Mon Sep 17 00:00:00 2001 From: Scoopta Date: Wed, 4 Sep 2019 16:01:10 -0700 Subject: [PATCH] Added a null check for the icon info --- src/wofi.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/wofi.c b/src/wofi.c index 4b44220..6d102f8 100644 --- a/src/wofi.c +++ b/src/wofi.c @@ -338,8 +338,12 @@ static void* do_drun(void* data) { GtkIconTheme* theme = gtk_icon_theme_get_default(); const gchar* const* icon_names = g_themed_icon_get_names(G_THEMED_ICON(icon)); GtkIconInfo* info = gtk_icon_theme_choose_icon(theme, (const gchar**) icon_names, image_size, 0); - const gchar* icon_path = gtk_icon_info_get_filename(info); - text = utils_concat(4, "img:", icon_path, ":text:", name); + if(info == NULL) { + text = utils_concat(2, "text:", name); + } else { + const gchar* icon_path = gtk_icon_info_get_filename(info); + text = utils_concat(4, "img:", icon_path, ":text:", name); + } } else { text = strdup(name); }