Survive absence of librsvg without criticals

We can't guarantee that we can load svgs, so
we shouldn't spew criticals when some of our
own resources fail to load due to that reason.
This commit is contained in:
Matthias Clasen 2019-04-18 00:12:34 +00:00
parent 69f12ed6a5
commit 0c87b62251

View File

@ -364,11 +364,14 @@ gtk_make_symbolic_texture_from_resource (const char *path,
GError **error)
{
GdkPixbuf *pixbuf;
GdkTexture *texture;
GdkTexture *texture = NULL;
pixbuf = gtk_make_symbolic_pixbuf_from_resource (path, width, height, scale, error);
texture = gdk_texture_new_for_pixbuf (pixbuf);
g_object_unref (pixbuf);
if (pixbuf)
{
texture = gdk_texture_new_for_pixbuf (pixbuf);
g_object_unref (pixbuf);
}
return texture;
}