pidgin: 53a98d6b: Reduce the number of g_return_val_if_fai...

qulogic at pidgin.im qulogic at pidgin.im
Sat Jun 6 19:15:39 EDT 2009


-----------------------------------------------------------------
Revision: 53a98d6b9517749003d34a480a466ede0ddbb344
Ancestor: c1c8f2c5f98a5e630006fc4d202bc5e8d61a5afa
Author: qulogic at pidgin.im
Date: 2009-06-06T22:53:50
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/53a98d6b9517749003d34a480a466ede0ddbb344

Modified files:
        libpurple/theme.c

ChangeLog: 

Reduce the number of g_return_val_if_fail calls for NULL input since that
appears to be a valid value in these cases.

-------------- next part --------------
============================================================
--- libpurple/theme.c	ddd26b9a3b9f76826b1ca8e09855dc59231d2fd0
+++ libpurple/theme.c	bf1830cb275d3d2744e02cf8ebd325d57eb55cbd
@@ -241,9 +241,12 @@ theme_clean_text(const gchar *text)
 static gchar *
 theme_clean_text(const gchar *text)
 {
-	gchar *clean_text = g_markup_escape_text(text, -1);
-	g_strdelimit(clean_text, "\n", ' ');
-	purple_str_strip_char(clean_text, '\r');
+	gchar *clean_text = NULL;
+	if (text != NULL) {
+		clean_text = g_markup_escape_text(text, -1);
+		g_strdelimit(clean_text, "\n", ' ');
+		purple_str_strip_char(clean_text, '\r');
+	}
 	return clean_text;
 }
 
@@ -389,9 +392,10 @@ purple_theme_get_image_full(PurpleTheme 
 {
 	const gchar *filename = purple_theme_get_image(theme);
 
-	g_return_val_if_fail(filename, NULL);
-
-	return g_build_filename(purple_theme_get_dir(PURPLE_THEME(theme)), filename, NULL);
+	if (filename)
+		return g_build_filename(purple_theme_get_dir(PURPLE_THEME(theme)), filename, NULL);
+	else
+		return NULL;
 }
 
 void


More information about the Commits mailing list