diff options
author | Benjamin Otte <otte@redhat.com> | 2011-05-27 23:58:10 +0200 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2011-06-02 02:03:51 +0200 |
commit | 940cdb4a7f1adcdd32b2fb9937e31ec55c35978d (patch) | |
tree | 96208e72ed70bc2df2efac6bfa6dbb95351f8959 | |
parent | 0d69d9558e17913aef203768881060c07c3dbc20 (diff) | |
download | gtk+-940cdb4a7f1adcdd32b2fb9937e31ec55c35978d.tar.gz |
stylecontext: Don't crash when colors are "none"
Instead, use their default value (pink).
-rw-r--r-- | gtk/gtkstylecontext.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/gtk/gtkstylecontext.c b/gtk/gtkstylecontext.c index b93dc367ca..d0ab18b21a 100644 --- a/gtk/gtkstylecontext.c +++ b/gtk/gtkstylecontext.c @@ -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"); } } |