]> Pileus Git - ~andy/gtk/commitdiff
stylecontext: Don't crash when colors are "none"
authorBenjamin Otte <otte@redhat.com>
Fri, 27 May 2011 21:58:10 +0000 (23:58 +0200)
committerBenjamin Otte <otte@redhat.com>
Thu, 2 Jun 2011 00:03:51 +0000 (02:03 +0200)
Instead, use their default value (pink).

gtk/gtkstylecontext.c

index b93dc367cacaef120e61b3e0fcd9821a3e96ad33..d0ab18b21a64f059efe52b55e0f08b6b53f122ef 100644 (file)
@@ -3369,7 +3369,10 @@ gtk_style_context_get_color (GtkStyleContext *context,
   if (value)
     {
       c = g_value_get_boxed (value);
-      *color = *c;
+      if (c)
+        *color = *c;
+      else
+        gdk_rgba_parse (color, "pink");
     }
 }
 
@@ -3410,7 +3413,10 @@ gtk_style_context_get_background_color (GtkStyleContext *context,
   if (value)
     {
       c = g_value_get_boxed (value);
-      *color = *c;
+      if (c)
+        *color = *c;
+      else
+        gdk_rgba_parse (color, "pink");
     }
 }
 
@@ -3451,7 +3457,10 @@ gtk_style_context_get_border_color (GtkStyleContext *context,
   if (value)
     {
       c = g_value_get_boxed (value);
-      *color = *c;
+      if (c)
+        *color = *c;
+      else
+        gdk_rgba_parse (color, "pink");
     }
 }