diff options
-rw-r--r-- | lotuswordpro/source/filter/lwpdoc.cxx | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lotuswordpro/source/filter/lwpdoc.cxx b/lotuswordpro/source/filter/lwpdoc.cxx index d83da250ddf6..65eb22784ec7 100644 --- a/lotuswordpro/source/filter/lwpdoc.cxx +++ b/lotuswordpro/source/filter/lwpdoc.cxx @@ -613,7 +613,10 @@ LwpDocument* LwpDocument::GetPreviousDivision() { if(!pRoot->IsChildDoc()) return pRoot; - pRoot = pRoot->GetParentDivision(); + LwpDocument* pNextRoot = pRoot->GetParentDivision(); + if (pNextRoot == pRoot) + throw std::runtime_error("loop in ParentDivision"); + pRoot = pNextRoot; } return nullptr; } |