Protect against NULL widget. (#379503)

2006-11-26  Benjamin Berg  <benjamin@sipsolutions.net>

	* gtk/gtkstyle.c: (gtk_default_draw_flat_box): Protect against NULL
	  widget. (#379503)
This commit is contained in:
Benjamin Berg 2006-11-26 19:43:12 +00:00 committed by Benjamin Berg
parent 7ad533044a
commit 683474c575
2 changed files with 7 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2006-11-26 Benjamin Berg <benjamin@sipsolutions.net>
* gtk/gtkstyle.c: (gtk_default_draw_flat_box): Protect against NULL
widget. (#379503)
2006-11-25 Matthias Clasen <mclasen@redhat.com>
* modules/printbackends/cups/gtkprintbackendcups.c: Make

View File

@ -3435,7 +3435,7 @@ gtk_default_draw_flat_box (GtkStyle *style,
!strcmp ("cell_even_ruled_sorted", detail))
{
/* This has to be really broken; alex made me do it. -jrb */
if (GTK_WIDGET_HAS_FOCUS (widget))
if (widget && GTK_WIDGET_HAS_FOCUS (widget))
gc1 = style->base_gc[state_type];
else
gc1 = style->base_gc[GTK_STATE_ACTIVE];
@ -3443,7 +3443,7 @@ gtk_default_draw_flat_box (GtkStyle *style,
else if (!strcmp ("cell_odd_ruled", detail) ||
!strcmp ("cell_odd_ruled_sorted", detail))
{
if (GTK_WIDGET_HAS_FOCUS (widget))
if (widget && GTK_WIDGET_HAS_FOCUS (widget))
freeme = get_darkened_gc (window, &style->base[state_type], 1);
else
freeme = get_darkened_gc (window, &style->base[GTK_STATE_ACTIVE], 1);