[gimp] app: do not assume PixbufStyle type exists.



commit 568c147f8da28d0d9acc3c1ebd5cb3f3d1804b0d
Author: Jehan <jehan girinstud io>
Date:   Fri Dec 1 20:59:58 2017 +0100

    app: do not assume PixbufStyle type exists.
    
    g_type_from_name ("PixbufStyle") might return 0. So we also need to
    protect this case.

 app/gui/themes.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/app/gui/themes.c b/app/gui/themes.c
index c756f02..e449c83 100644
--- a/app/gui/themes.c
+++ b/app/gui/themes.c
@@ -87,10 +87,13 @@ themes_init (Gimp *gimp)
    * be removed for GIMP 3.
    * See https://bugzilla.gnome.org/show_bug.cgi?id=770424
    */
-  pixbuf_style_type_class = g_type_class_ref (g_type_from_name ("PixbufStyle"));
-  if (pixbuf_style_type_class)
+  if (g_type_from_name ("PixbufStyle"))
     {
-      GTK_STYLE_CLASS (pixbuf_style_type_class)->draw_layout = themes_draw_layout;
+      pixbuf_style_type_class = g_type_class_ref (g_type_from_name ("PixbufStyle"));
+      if (pixbuf_style_type_class)
+        {
+          GTK_STYLE_CLASS (pixbuf_style_type_class)->draw_layout = themes_draw_layout;
+        }
     }
 
   config = GIMP_GUI_CONFIG (gimp->config);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]