summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPranav Kant <pranavk@collabora.com>2016-02-14 02:53:16 +0530
committerPranav Kant <pranavk@collabora.com>2016-02-14 02:54:39 +0530
commitf01bac5cc2b54b6df731b45c46187fec12515b46 (patch)
tree4664a749f66b754b0a1b04e8fab59132d0428a06
parent78284714b73a8307174c596295894e8f3951e09a (diff)
tdf#97301: Return silently when no document is loaded
Change-Id: Id6cf77ee7597fb992a306649c2f2a3639bf6dad8
-rw-r--r--libreofficekit/source/gtk/lokdocview.cxx3
1 files changed, 3 insertions, 0 deletions
diff --git a/libreofficekit/source/gtk/lokdocview.cxx b/libreofficekit/source/gtk/lokdocview.cxx
index c7dceaa9e86a..742946de8122 100644
--- a/libreofficekit/source/gtk/lokdocview.cxx
+++ b/libreofficekit/source/gtk/lokdocview.cxx
@@ -2663,6 +2663,9 @@ lok_doc_view_set_zoom (LOKDocView* pDocView, float fZoom)
LOKDocViewPrivate& priv = getPrivate(pDocView);
GError* error = nullptr;
+ if (!priv->m_pDocument)
+ return;
+
// Clamp the input value in [MIN_ZOOM, MAX_ZOOM]
fZoom = fZoom < MIN_ZOOM ? MIN_ZOOM : fZoom;
fZoom = fZoom > MAX_ZOOM ? MAX_ZOOM : fZoom;