summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Dufresne <nicolas.dufresne@collabora.co.uk>2011-03-16 15:27:39 -0400
committerNicolas Dufresne <nicolas.dufresne@collabora.co.uk>2011-03-16 15:27:39 -0400
commit83edfa4ffbddf7ff62432bbd82b446ed3d2e854d (patch)
treeb0d4126a74de9a5ee32c412c43a22fc2a197a8e2
parent0b86a27be7ecd4401696624b925e4719b9a4f31a (diff)
Fix got_sender_contact_by_id_cb error handling
This bug was introduced by 5cc352873f102b6a43c2a95b71a9a2e5a38526ab
-rw-r--r--telepathy-glib/text-channel.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/telepathy-glib/text-channel.c b/telepathy-glib/text-channel.c
index 2658674a8..dec83cdd9 100644
--- a/telepathy-glib/text-channel.c
+++ b/telepathy-glib/text-channel.c
@@ -406,8 +406,14 @@ got_sender_contact_by_id_cb (TpConnection *connection,
{
DEBUG ("Failed to prepare TpContact: %s", error->message);
}
- else if (n_contacts != 1)
+ else if (n_contacts > 0)
{
+ sender = contacts[0];
+ }
+ else
+ {
+ DEBUG ("TpContact of the sender hasn't be prepared");
+
if (DEBUGGING)
{
GHashTableIter iter;
@@ -420,12 +426,6 @@ got_sender_contact_by_id_cb (TpConnection *connection,
(const gchar *) key, ((GError *) value)->message);
}
}
-
- sender = contacts[0];
- }
- else
- {
- DEBUG ("TpContact of the sender hasn't be prepared");
}
add_message_received (self, parts, sender, TRUE);