charsets: don't crash when passing a NULL string to the UTF-8 converter

This commit is contained in:
Aleksander Morgado
2012-02-08 12:06:59 -06:00
committed by Dan Williams
parent 7b4d6cf605
commit 1db0004033
+3
View File
@@ -714,6 +714,9 @@ mm_charset_take_and_convert_to_utf8 (gchar *str,
{
gchar *utf8 = NULL;
if (!str)
return NULL;
switch (charset) {
case MM_MODEM_CHARSET_UNKNOWN:
g_warn_if_reached ();