From 26024d8ad63511ec46f928d12bc2689098480104 Mon Sep 17 00:00:00 2001 From: Will Thompson Date: Sat, 13 Feb 2010 16:10:53 +0000 Subject: Don't crash when switching to a tab with no TpChat Fixes: #609843 --- libempathy-gtk/empathy-chat.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libempathy-gtk/empathy-chat.c b/libempathy-gtk/empathy-chat.c index d27337b25..5702adb70 100644 --- a/libempathy-gtk/empathy-chat.c +++ b/libempathy-gtk/empathy-chat.c @@ -2947,8 +2947,12 @@ empathy_chat_messages_read (EmpathyChat *self) g_return_if_fail (EMPATHY_IS_CHAT (self)); - empathy_tp_chat_acknowledge_messages (priv->tp_chat, + if (priv->tp_chat != NULL) { + empathy_tp_chat_acknowledge_messages (priv->tp_chat, priv->pending_messages); + } + /* ...else, we can't do any acknowledging because the channel (or + * indeed connection) has gone away. */ while (priv->pending_messages != NULL) { g_object_unref (priv->pending_messages->data); -- cgit v1.2.3