comparison libpurple/protocols/myspace/markup.c @ 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 61045691aa72
children 89c7be36fd61 36377c25417d
comparison
equal deleted inserted replaced
20859:817425918f92 20860:2447efa8c93b
398 /** Convert an individual msim markup tag to HTML. */ 398 /** Convert an individual msim markup tag to HTML. */
399 static void 399 static void
400 msim_markup_tag_to_html(MsimSession *session, xmlnode *root, gchar **begin, 400 msim_markup_tag_to_html(MsimSession *session, xmlnode *root, gchar **begin,
401 gchar **end) 401 gchar **end)
402 { 402 {
403 g_return_if_fail(root != NULL);
404
403 if (g_str_equal(root->name, "f")) { 405 if (g_str_equal(root->name, "f")) {
404 msim_markup_f_to_html(session, root, begin, end); 406 msim_markup_f_to_html(session, root, begin, end);
405 } else if (g_str_equal(root->name, "a")) { 407 } else if (g_str_equal(root->name, "a")) {
406 msim_markup_a_to_html(session, root, begin, end); 408 msim_markup_a_to_html(session, root, begin, end);
407 } else if (g_str_equal(root->name, "p")) { 409 } else if (g_str_equal(root->name, "p")) {
413 } else if (g_str_equal(root->name, "i")) { 415 } else if (g_str_equal(root->name, "i")) {
414 msim_markup_i_to_html(session, root, begin, end); 416 msim_markup_i_to_html(session, root, begin, end);
415 } else { 417 } else {
416 purple_debug_info("msim", "msim_markup_tag_to_html: " 418 purple_debug_info("msim", "msim_markup_tag_to_html: "
417 "unknown tag name=%s, ignoring", 419 "unknown tag name=%s, ignoring",
418 (root && root->name) ? root->name : "(NULL)"); 420 root->name ? root->name : "(NULL)");
419 *begin = g_strdup(""); 421 *begin = g_strdup("");
420 *end = g_strdup(""); 422 *end = g_strdup("");
421 } 423 }
422 } 424 }
423 425