changeset 26872:6a177edc401e

Avoid a g_markup_escape_text assertion failure
author Paul Aurich <paul@darkrain42.org>
date Sun, 03 May 2009 06:36:05 +0000
parents 6c9e264aa88d
children 5872d1bc546f
files libpurple/protocols/jabber/caps.c
diffstat 1 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/jabber/caps.c	Sat May 02 23:35:19 2009 +0000
+++ b/libpurple/protocols/jabber/caps.c	Sun May 03 06:36:05 2009 +0000
@@ -826,8 +826,13 @@
 		JabberIdentity *id = (JabberIdentity*)node->data;
 		char *category = g_markup_escape_text(id->category, -1);
 		char *type = g_markup_escape_text(id->type, -1);
-		char *lang = g_markup_escape_text(id->lang, -1);
-		char *name = g_markup_escape_text(id->name, -1);
+		char *lang = NULL;
+		char *name = NULL;
+		
+		if (id->lang)
+			lang = g_markup_escape_text(id->lang, -1);
+		if (id->name)
+			name = g_markup_escape_text(id->name, -1);
 
 		g_string_append_printf(verification, "%s/%s/%s/%s<", category,
 		        type, lang ? lang : "", name ? name : "");