changeset 29820:245f3432a5ab

Avoid trying to build a filename and pixbuf if there's no image filename.
author Richard Laager <rlaager@wiktel.com>
date Sun, 16 Nov 2008 10:06:26 +0000
parents 5f8fc6e7466a
children 50dbd779f1bb
files pidgin/gtkrequest.c
diffstat 1 files changed, 8 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/pidgin/gtkrequest.c	Sun Nov 16 08:44:14 2008 +0000
+++ b/pidgin/gtkrequest.c	Sun Nov 16 10:06:26 2008 +0000
@@ -997,7 +997,6 @@
 	GtkTreeIter iter;
 	GList *l;
 	GList *icons = NULL;
-	GdkPixbuf* pixbuf;
 
 	icons = purple_request_field_list_get_icons(field);
 
@@ -1051,11 +1050,15 @@
 		if (icons)
 		{
 			const char *icon_path = (const char *)icons->data;
-			char* filename = g_build_filename(DATADIR, icon_path, NULL);
+			char* filename;
+			GdkPixbuf* pixbuf = NULL;
 
-			pixbuf = gdk_pixbuf_new_from_file(filename, NULL);
-
-			g_free(filename);
+			if (icon_path)
+			{
+				filename = g_build_filename(DATADIR, icon_path, NULL);
+				pixbuf = gdk_pixbuf_new_from_file(filename, NULL);
+				g_free(filename);
+			}
 
 			gtk_list_store_set(store, &iter,
 						   0, purple_request_field_list_get_data(field, text),