changeset 17438:a4c1e66620e3

Fix a crash when trying to use XMPP console with no XMPP accounts connected
author Stu Tomlinson <stu@nosnilmot.com>
date Sat, 02 Jun 2007 16:06:59 +0000
parents 8e20bb5640ed
children 6fefda6a7d57
files pidgin/plugins/xmppconsole.c
diffstat 1 files changed, 7 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/pidgin/plugins/xmppconsole.c	Sat Jun 02 14:57:17 2007 +0000
+++ b/pidgin/plugins/xmppconsole.c	Sat Jun 02 16:06:59 2007 +0000
@@ -183,16 +183,17 @@
 	char *text;
 
 	gc = console->gc;
-	
-	prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(gc->prpl);
-	
+
+	if (gc)
+		prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(gc->prpl);
+
 	buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(console->entry));
 	gtk_text_buffer_get_start_iter(buffer, &start);
 	gtk_text_buffer_get_end_iter(buffer, &end);
-		
+
 	text = gtk_imhtml_get_text(GTK_IMHTML(console->entry), &start, &end);
-			
-	if (gc && prpl_info->convo_closed != NULL)
+
+	if (prpl_info && prpl_info->send_raw != NULL)
 		prpl_info->send_raw(gc, text, strlen(text));
 
 	g_free(text);