From b8c34c87f5e22ad5d3f387cf0b5f8d6088da14be Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Thu, 26 Sep 2013 14:22:25 +0100 Subject: [PATCH 2/2] Account: don't crash if a CM returns a non-(ays) Avatar --- telepathy-glib/account.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/telepathy-glib/account.c b/telepathy-glib/account.c index 04b25a5..9aac94a 100644 --- a/telepathy-glib/account.c +++ b/telepathy-glib/account.c @@ -3482,6 +3482,12 @@ _tp_account_got_avatar_cb (TpProxy *proxy, DEBUG ("Failed to get avatar: %s", error->message); g_simple_async_result_set_from_error (result, error); } + else if (!G_VALUE_HOLDS (out_Value, TP_STRUCT_TYPE_AVATAR)) + { + DEBUG ("Avatar had wrong type: %s", G_VALUE_TYPE_NAME (out_Value)); + g_simple_async_result_set_error (result, TP_ERROR, TP_ERROR_CONFUSED, + "Incorrect type for Avatar property"); + } else { avatar = g_value_get_boxed (out_Value); -- 1.8.4.rc3