changeset 28382:ef513141e960

jabber: Reduce these from assertions to checks. Both of those are triggered by double-clicking on an already-open chat in the buddy list, so they shouldn't be assertions.
author Paul Aurich <paul@darkrain42.org>
date Thu, 15 Oct 2009 16:13:00 +0000
parents 5550823608cb
children d5ff2cd6064a
files libpurple/protocols/jabber/chat.c
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/jabber/chat.c	Tue Oct 13 19:52:35 2009 +0000
+++ b/libpurple/protocols/jabber/chat.c	Thu Oct 15 16:13:00 2009 +0000
@@ -216,7 +216,8 @@
 	JabberChat *chat;
 	char *jid;
 
-	g_return_val_if_fail(jabber_chat_find(js, room, server) == NULL, NULL);
+	if (jabber_chat_find(js, room, server) != NULL)
+		return NULL;
 
 	chat = g_new0(JabberChat, 1);
 	chat->js = js;
@@ -264,7 +265,8 @@
 	char *jid;
 
 	chat = jabber_chat_new(js, room, server, handle, password, data);
-	g_return_val_if_fail(chat != NULL, NULL);
+	if (chat == NULL)
+		return NULL;
 
 	gc = js->gc;
 	account = purple_connection_get_account(gc);