From 940cdb4a7f1adcdd32b2fb9937e31ec55c35978d Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Fri, 27 May 2011 23:58:10 +0200 Subject: [PATCH] stylecontext: Don't crash when colors are "none" Instead, use their default value (pink). --- gtk/gtkstylecontext.c | 15 ++++++++++++--- 1 file 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"); } }