Mercurial > pidgin.yaz
changeset 27129:f70e86aec7d0
Reduce the number of g_return_val_if_fail calls for NULL input since that
appears to be a valid value in these cases.
author | Elliott Sales de Andrade <qulogic@pidgin.im> |
---|---|
date | Sat, 06 Jun 2009 22:53:50 +0000 |
parents | a4574f513be5 |
children | f27198aad234 |
files | libpurple/theme.c |
diffstat | 1 files changed, 10 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/libpurple/theme.c Sat Jun 06 05:45:26 2009 +0000 +++ b/libpurple/theme.c Sat Jun 06 22:53:50 2009 +0000 @@ -241,9 +241,12 @@ 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 @@ { 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