diff options
author | Matthias Clasen <mclasen@redhat.com> | 2019-04-18 00:12:34 +0000 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2019-04-18 00:14:00 +0000 |
commit | 0c87b6225142cb97e1ffa763bca26ee0e1b8f717 (patch) | |
tree | c2e409f3bebd283675dc1bc9703238dde29094db /gtk/tools/gdkpixbufutils.c | |
parent | 69f12ed6a5f48b90c1060d76764307c1d5167197 (diff) | |
download | gtk+-0c87b6225142cb97e1ffa763bca26ee0e1b8f717.tar.gz |
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.
Diffstat (limited to 'gtk/tools/gdkpixbufutils.c')
-rw-r--r-- | gtk/tools/gdkpixbufutils.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/gtk/tools/gdkpixbufutils.c b/gtk/tools/gdkpixbufutils.c index 0ed23bd3dc..0f4b7f09b5 100644 --- a/gtk/tools/gdkpixbufutils.c +++ b/gtk/tools/gdkpixbufutils.c @@ -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; } |