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

This commit is contained in:
Aleksander Morgado
2012-02-08 16:29:27 +01:00
committed by Dan Williams
parent 7b4d6cf605
commit 1db0004033

View File

@@ -714,6 +714,9 @@ mm_charset_take_and_convert_to_utf8 (gchar *str,
{ {
gchar *utf8 = NULL; gchar *utf8 = NULL;
if (!str)
return NULL;
switch (charset) { switch (charset) {
case MM_MODEM_CHARSET_UNKNOWN: case MM_MODEM_CHARSET_UNKNOWN:
g_warn_if_reached (); g_warn_if_reached ();