changeset 27137:2d258a809609

Avoid an assertion when the UI doesn't have a get_ui_info ui_op
author Paul Aurich <paul@darkrain42.org>
date Sat, 06 Jun 2009 06:45:53 +0000
parents dd7e7071d46d
children d46acd32a18d
files libpurple/protocols/jabber/jabber.c
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/jabber/jabber.c	Sat Jun 06 06:33:18 2009 +0000
+++ b/libpurple/protocols/jabber/jabber.c	Sat Jun 06 06:45:53 2009 +0000
@@ -3420,10 +3420,13 @@
 jabber_init_plugin(PurplePlugin *plugin)
 {
 	GHashTable *ui_info = purple_core_get_ui_info();
-	const gchar *ui_type = g_hash_table_lookup(ui_info, "client_type");
+	const gchar *ui_type;
 	const gchar *type = "pc"; /* default client type, if unknown or 
 								unspecified */
 
+	jabber_plugin = plugin;
+
+	ui_type = ui_info ? g_hash_table_lookup(ui_info, "client_type") : NULL;
 	if (ui_type) {
 		if (strcmp(ui_type, "pc") == 0 ||
 			strcmp(ui_type, "console") == 0 ||
@@ -3434,7 +3437,6 @@
 			type = ui_type;
 		}
 	}
-	jabber_plugin = plugin;
 
 	jabber_add_identity("client", type, NULL, PACKAGE);