gresource: Avoid work for NULL errors

Don't go through gettext if the GError** passed is NULL anyway.
This commit is contained in:
Timm Bäder 2020-12-31 12:58:43 +01:00
parent 89f12e10b6
commit 105e44beb5

View File

@ -929,6 +929,7 @@ g_resource_enumerate_children (GResource *resource,
if (*path == 0)
{
if (error)
g_set_error (error, G_RESOURCE_ERROR, G_RESOURCE_ERROR_NOT_FOUND,
_("The resource at “%s” does not exist"),
path);
@ -968,6 +969,7 @@ g_resource_enumerate_children (GResource *resource,
if (children == NULL)
{
if (error)
g_set_error (error, G_RESOURCE_ERROR, G_RESOURCE_ERROR_NOT_FOUND,
_("The resource at “%s” does not exist"),
path);
@ -1237,6 +1239,7 @@ g_resources_enumerate_children (const gchar *path,
if (hash == NULL)
{
if (error)
g_set_error (error, G_RESOURCE_ERROR, G_RESOURCE_ERROR_NOT_FOUND,
_("The resource at “%s” does not exist"),
path);