cpw.rekkanoryo.icqxstatus: b6e77fc4: Avoid trying to build a filename and pix...

rlaager at pidgin.im rlaager at pidgin.im
Sun Nov 16 14:21:08 EST 2008


-----------------------------------------------------------------
Revision: b6e77fc455d1a8fb1f2a091c843015a7f157a38e
Ancestor: f8f682f0531fbab4d74ce9a2782782b782506177
Author: rlaager at pidgin.im
Date: 2008-11-16T10:06:26
Branch: im.pidgin.cpw.rekkanoryo.icqxstatus
URL: http://d.pidgin.im/viewmtn/revision/info/b6e77fc455d1a8fb1f2a091c843015a7f157a38e

Modified files:
        pidgin/gtkrequest.c

ChangeLog: 

Avoid trying to build a filename and pixbuf if there's no image filename.

-------------- next part --------------
============================================================
--- pidgin/gtkrequest.c	afe91b559c3619ca39d5cc1c79307806e0a160e9
+++ pidgin/gtkrequest.c	1827df3b5af7e2b6ccddd9b4f039a081c4fbfcbf
@@ -997,7 +997,6 @@ create_list_field(PurpleRequestField *fi
 	GtkTreeIter iter;
 	GList *l;
 	GList *icons = NULL;
-	GdkPixbuf* pixbuf;
 
 	icons = purple_request_field_list_get_icons(field);
 
@@ -1051,12 +1050,16 @@ create_list_field(PurpleRequestField *fi
 		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);
+			if (icon_path)
+			{
+				filename = g_build_filename(DATADIR, icon_path, NULL);
+				pixbuf = gdk_pixbuf_new_from_file(filename, NULL);
+				g_free(filename);
+			}
 
-			g_free(filename);
-
 			gtk_list_store_set(store, &iter,
 						   0, purple_request_field_list_get_data(field, text),
 						   1, text,


More information about the Commits mailing list