diff --git a/sw/source/core/unocore/unotext.cxx b/sw/source/core/unocore/unotext.cxx index 5d9bde6d73a7..5ecc6fbf399b 100644 --- a/sw/source/core/unocore/unotext.cxx +++ b/sw/source/core/unocore/unotext.cxx @@ -559,7 +559,7 @@ SwXText::insertTextContent( pTmp = pTmp->StartOfSectionNode(); } // if the document starts with a section - while (pOwnStartNode->IsSectionNode()) + while (pOwnStartNode && pOwnStartNode->IsSectionNode()) { pOwnStartNode = pOwnStartNode->StartOfSectionNode(); }