Check that error exists before trying to set it. Fixes bug #640975.

This commit is contained in:
Ignacio Casal Quinteiro 2011-01-31 13:34:26 +01:00
parent 72a8282231
commit 401a4233e4

View File

@ -769,13 +769,14 @@ g_convert_with_iconv (const gchar *str,
have_error = TRUE;
break;
default:
{
int errsv = errno;
g_set_error (error, G_CONVERT_ERROR, G_CONVERT_ERROR_FAILED,
_("Error during conversion: %s"),
g_strerror (errsv));
}
if (error)
{
int errsv = errno;
g_set_error (error, G_CONVERT_ERROR, G_CONVERT_ERROR_FAILED,
_("Error during conversion: %s"),
g_strerror (errsv));
}
have_error = TRUE;
break;
}