diff --git a/src/sheet-object-widget.c b/src/sheet-object-widget.c
index 5763909..2c13a17 100644
--- a/src/sheet-object-widget.c
+++ b/src/sheet-object-widget.c
@@ -225,14 +225,16 @@ static void
 sheet_widget_draw_cairo (SheetObject const *so, cairo_t *cr,
 			 double width, double height)
 {
-	GtkWidget *win = gtk_offscreen_window_new ();
-	GtkWidget *w = SOW_CLASS(so)->create_widget (GNM_SOW (so));
-
-	gtk_container_add (GTK_CONTAINER (win), w);
-	gtk_widget_set_size_request (w, width, height);
-	gtk_widget_show_all (win);
-	gtk_container_propagate_draw (GTK_CONTAINER (win), w, cr);
-	gtk_widget_destroy (win);
+	if (NULL != gdk_screen_get_default ()) {
+		GtkWidget *win = gtk_offscreen_window_new ();
+		GtkWidget *w = SOW_CLASS(so)->create_widget (GNM_SOW (so));
+		
+		gtk_container_add (GTK_CONTAINER (win), w);
+		gtk_widget_set_size_request (w, width, height);
+		gtk_widget_show_all (win);
+		gtk_container_propagate_draw (GTK_CONTAINER (win), w, cr);
+		gtk_widget_destroy (win);
+	}
 }
 
 static void
