diff options
-rw-r--r-- | libempathy-gtk/empathy-avatar-chooser.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/libempathy-gtk/empathy-avatar-chooser.c b/libempathy-gtk/empathy-avatar-chooser.c index 71981ce71..2dbf599b6 100644 --- a/libempathy-gtk/empathy-avatar-chooser.c +++ b/libempathy-gtk/empathy-avatar-chooser.c @@ -756,6 +756,18 @@ avatar_chooser_response_cb (GtkWidget *widget, gint response, EmpathyAvatarChooser *chooser) { + EmpathyAvatarChooserPriv *priv = GET_PRIV (chooser); + + if (response == GTK_RESPONSE_CANCEL) { + goto out; + } + + /* Check if we went non-ready since displaying the dialog. */ + if (!empathy_tp_contact_factory_is_ready (priv->tp_contact_factory)) { + DEBUG ("Can't set avatar when contact factory isn't ready."); + goto out; + } + if (response == GTK_RESPONSE_OK) { gchar *filename; gchar *path; @@ -777,6 +789,7 @@ avatar_chooser_response_cb (GtkWidget *widget, avatar_chooser_clear_image (chooser); } +out: gtk_widget_destroy (widget); } |