aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk/empathy-avatar-chooser.c
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@src.gnome.org>2008-11-11 23:26:36 +0800
committerXavier Claessens <xclaesse@src.gnome.org>2008-11-11 23:26:36 +0800
commitf392463566343c1265b7e3443a7185185153daa1 (patch)
tree7d88f6f4c69156c7dc360c6f671e3065cae47c80 /libempathy-gtk/empathy-avatar-chooser.c
parent3ab214c29c9a50e99eb3f775ad5f09b3a49e9b31 (diff)
downloadgsoc2013-empathy-f392463566343c1265b7e3443a7185185153daa1.tar
gsoc2013-empathy-f392463566343c1265b7e3443a7185185153daa1.tar.gz
gsoc2013-empathy-f392463566343c1265b7e3443a7185185153daa1.tar.bz2
gsoc2013-empathy-f392463566343c1265b7e3443a7185185153daa1.tar.lz
gsoc2013-empathy-f392463566343c1265b7e3443a7185185153daa1.tar.xz
gsoc2013-empathy-f392463566343c1265b7e3443a7185185153daa1.tar.zst
gsoc2013-empathy-f392463566343c1265b7e3443a7185185153daa1.zip
Check the contact factory is still ready when avatar picker is OKed.
svn path=/trunk/; revision=1685
Diffstat (limited to 'libempathy-gtk/empathy-avatar-chooser.c')
-rw-r--r--libempathy-gtk/empathy-avatar-chooser.c13
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);
}