changeset 23339:96dd27f5b45b

Avoid calling purple_str_sub_away_formatters() and g_markup_escape_text() with NULL strings.
author Evan Schoenberg <evan.s@dreskin.net>
date Mon, 09 Jun 2008 18:04:13 +0000
parents dd21962a8a1d
children c80746c7c96c
files libpurple/protocols/oscar/oscar.c
diffstat 1 files changed, 11 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/oscar/oscar.c	Mon Jun 09 17:28:08 2008 +0000
+++ b/libpurple/protocols/oscar/oscar.c	Mon Jun 09 18:04:13 2008 +0000
@@ -844,7 +844,7 @@
 		/* Away messges are HTML, but available messages were originally plain text.
 		 * We therefore need to strip away messages but not available messages if we're asked to remove HTML tags.
 		 */
-		if (is_away) {
+		if (is_away && message) {
 			gchar *tmp2;
 			tmp = purple_markup_strip_html(message);
 			g_free(message);
@@ -854,16 +854,16 @@
 		}
 
 	} else {
-	if (itmsurl) {
-		tmp = g_strdup_printf("<a href=\"%s\">%s</a>",
-							  itmsurl, message);
-		g_free(itmsurl);
-		g_free(message);
-		message = tmp;
-	}
-	}
-
-	if (is_away) {
+		if (itmsurl) {
+			tmp = g_strdup_printf("<a href=\"%s\">%s</a>",
+								  itmsurl, message);
+			g_free(itmsurl);
+			g_free(message);
+			message = tmp;
+		}
+	}
+
+	if (is_away && message) {
 		tmp = purple_str_sub_away_formatters(message, purple_account_get_username(account));
 		g_free(message);
 		message = tmp;