changeset 20860:2447efa8c93b

Move NULL check earlier to prevent confusion when it is checked after being derefed. Fixes CID 350
author Daniel Atallah <daniel.atallah@gmail.com>
date Wed, 10 Oct 2007 00:00:21 +0000
parents 817425918f92
children 9c2ec10933b2
files libpurple/protocols/myspace/markup.c
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/myspace/markup.c	Tue Oct 09 23:46:46 2007 +0000
+++ b/libpurple/protocols/myspace/markup.c	Wed Oct 10 00:00:21 2007 +0000
@@ -400,6 +400,8 @@
 msim_markup_tag_to_html(MsimSession *session, xmlnode *root, gchar **begin, 
 		gchar **end)
 {
+	g_return_if_fail(root != NULL);
+
 	if (g_str_equal(root->name, "f")) {
 		msim_markup_f_to_html(session, root, begin, end);
 	} else if (g_str_equal(root->name, "a")) {
@@ -415,7 +417,7 @@
 	} else {
 		purple_debug_info("msim", "msim_markup_tag_to_html: "
 				"unknown tag name=%s, ignoring", 
-				(root && root->name) ? root->name : "(NULL)");
+				root->name ? root->name : "(NULL)");
 		*begin = g_strdup("");
 		*end = g_strdup("");
 	}