diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c index f537433418..92e0dc5f83 100644 --- a/gtk/gtkwidget.c +++ b/gtk/gtkwidget.c @@ -10336,7 +10336,7 @@ update_pango_context (GtkWidget *widget, 100)); screen = gtk_widget_get_screen_unchecked (widget); - if (widget->priv->font_options) + if (screen && widget->priv->font_options) { cairo_font_options_t *options; @@ -10345,7 +10345,7 @@ update_pango_context (GtkWidget *widget, pango_cairo_context_set_font_options (context, options); cairo_font_options_destroy (options); } - else + else if (screen) { pango_cairo_context_set_font_options (context, gdk_screen_get_font_options (screen));