From b75e793621bbac52bf72e7b1032db542cce9dac8 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 9 Dec 2015 12:41:48 +0000 Subject: guard against missing RootDocument Change-Id: I1c6b58b58ab489a17419dbf7cd4ecec63359b7f3 (cherry picked from commit 0f700d5bc9c0ebc1e1ebe60758fbbf02590790bc) Reviewed-on: https://gerrit.libreoffice.org/20517 Reviewed-by: David Tardon Tested-by: David Tardon Reviewed-by: Miklos Vajna Reviewed-by: Michael Stahl --- lotuswordpro/source/filter/lwpdoc.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lotuswordpro/source/filter/lwpdoc.cxx b/lotuswordpro/source/filter/lwpdoc.cxx index ba6ab5838c02..fcbc8945aac7 100644 --- a/lotuswordpro/source/filter/lwpdoc.cxx +++ b/lotuswordpro/source/filter/lwpdoc.cxx @@ -634,8 +634,8 @@ LwpDocument* LwpDocument::GetPreviousDivision() LwpDocument* LwpDocument::GetLastDivisionThatHasEndnote() { LwpDocument* pRoot = GetRootDocument(); - LwpDocument *pLastDoc = pRoot->GetLastDivisionWithContents(); - while(pLastDoc) + LwpDocument *pLastDoc = pRoot ? pRoot->GetLastDivisionWithContents() : nullptr; + while (pLastDoc) { if(pLastDoc->GetEnSuperTableLayout()) return pLastDoc; -- cgit v1.2.3