changeset 29382:b066ad9bbcc3

Don't try to save the edit dialog pointer to a NULL PurpleSmiley (aka, when adding a new one).
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Sun, 07 Feb 2010 08:22:11 +0000
parents b1df98334930
children 9af18bfb16aa
files pidgin/gtksmiley.c
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/pidgin/gtksmiley.c	Sun Feb 07 08:20:40 2010 +0000
+++ b/pidgin/gtksmiley.c	Sun Feb 07 08:22:11 2010 +0000
@@ -74,7 +74,8 @@
 static void
 pidgin_smiley_destroy(PidginSmiley *smiley)
 {
-	g_object_set_data(G_OBJECT(smiley->smiley), "edit-dialog", NULL);
+	if (smiley->smiley)
+		g_object_set_data(G_OBJECT(smiley->smiley), "edit-dialog", NULL);
 	gtk_widget_destroy(smiley->parent);
 	g_free(smiley->filename);
 	if (smiley->custom_pixbuf)
@@ -403,7 +404,8 @@
 			smiley ? GTK_STOCK_SAVE : GTK_STOCK_ADD, GTK_RESPONSE_ACCEPT,
 			NULL);
 	s->parent = window;
-	g_object_set_data(G_OBJECT(smiley), "edit-dialog", window);
+	if (smiley)
+		g_object_set_data(G_OBJECT(smiley), "edit-dialog", window);
 
 	gtk_container_set_border_width(GTK_CONTAINER(window), PIDGIN_HIG_BORDER);