summaryrefslogtreecommitdiff
path: root/libreofficekit/source/gtk/lokdocview.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'libreofficekit/source/gtk/lokdocview.cxx')
-rw-r--r--libreofficekit/source/gtk/lokdocview.cxx2
1 files changed, 2 insertions, 0 deletions
diff --git a/libreofficekit/source/gtk/lokdocview.cxx b/libreofficekit/source/gtk/lokdocview.cxx
index 58747a5a73ab..fc58dd433b66 100644
--- a/libreofficekit/source/gtk/lokdocview.cxx
+++ b/libreofficekit/source/gtk/lokdocview.cxx
@@ -345,6 +345,8 @@ doSearch(LOKDocView* pDocView, const char* pText, bool bBackwards, bool highligh
boost::property_tree::ptree aTree;
GtkWidget* drawingWidget = GTK_WIDGET(pDocView);
GdkWindow* drawingWindow = gtk_widget_get_window(drawingWidget);
+ if (!drawingWindow)
+ return;
std::shared_ptr<cairo_region_t> cairoVisRegion( gdk_window_get_visible_region(drawingWindow),
cairo_region_destroy);
cairo_rectangle_int_t cairoVisRect;