pixbuf engine: Avoid a crash if widget is NULL

Commit 85f2a721cf introduced an unconditional call to
gtk_widget_get_direction(). This does not work for 'foreign'
uses of the theme engine, e.g. in Qt, where widget is NULL.

This was reported as a crash in Fedora here:
https://bugzilla.redhat.com/show_bug.cgi?id=924683
This commit is contained in:
Matthias Clasen
2014-09-29 16:05:57 -04:00
parent 03c53357f6
commit 1d0e2d5838

View File

@ -131,7 +131,7 @@ draw_simple_image(GtkStyle *style,
match_data->orientation = GTK_ORIENTATION_HORIZONTAL; match_data->orientation = GTK_ORIENTATION_HORIZONTAL;
} }
if (!(match_data->flags & THEME_MATCH_DIRECTION)) if (widget && !(match_data->flags & THEME_MATCH_DIRECTION))
{ {
match_data->flags |= THEME_MATCH_DIRECTION; match_data->flags |= THEME_MATCH_DIRECTION;
match_data->direction = gtk_widget_get_direction (widget); match_data->direction = gtk_widget_get_direction (widget);