From f4e13bc973ed50bed80f2833dc8e5bc7a69bb44e Mon Sep 17 00:00:00 2001 From: Pranav Kant Date: Sun, 21 Feb 2016 01:28:56 +0530 Subject: [PATCH] tdf#97235: Protect reset_view when called with no tile buffer initialized This can happen when no document has been loaded yet. Change-Id: Ib9c18e22b6c344528d05eb781bf9b3052060089a --- libreofficekit/source/gtk/lokdocview.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libreofficekit/source/gtk/lokdocview.cxx b/libreofficekit/source/gtk/lokdocview.cxx index e771b0504866..3ecf52ccf6c7 100644 --- a/libreofficekit/source/gtk/lokdocview.cxx +++ b/libreofficekit/source/gtk/lokdocview.cxx @@ -2825,7 +2825,9 @@ SAL_DLLPUBLIC_EXPORT void lok_doc_view_reset_view(LOKDocView* pDocView) { LOKDocViewPrivate& priv = getPrivate(pDocView); - priv->m_pTileBuffer->resetAllTiles(); + + if (priv->m_pTileBuffer != nullptr) + priv->m_pTileBuffer->resetAllTiles(); priv->m_nLoadProgress = 0.0; memset(&priv->m_aVisibleCursor, 0, sizeof(priv->m_aVisibleCursor));