summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2023-05-19 16:12:18 +0200
committerXisco Fauli <xiscofauli@libreoffice.org>2023-05-23 12:45:45 +0200
commit0916808ed8f39604bc105cd74200090a409e8618 (patch)
treecafc962734d1959b980a55623961b6ec6693c6d1 /sw
parent639519dc2bad058197b6ff73c9e3df622f979f97 (diff)
sw: fix crash in DocumentLayoutManager::CopyLayoutFormat
See https://crashreport.libreoffice.org/stats/signature/sw::DocumentLayoutManager::CopyLayoutFormat(SwFrameFormat%20const%20&,SwFormatAnchor%20const%20&,bool,bool) Change-Id: I1680bb79be4c1eb2ff18ed46dfa286da5e729e63 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152015 Reviewed-by: Michael Stahl <michael.stahl@allotropia.de> Tested-by: Jenkins
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/doc/DocumentLayoutManager.cxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/sw/source/core/doc/DocumentLayoutManager.cxx b/sw/source/core/doc/DocumentLayoutManager.cxx
index 6959b7c7ba3a..6481f104c737 100644
--- a/sw/source/core/doc/DocumentLayoutManager.cxx
+++ b/sw/source/core/doc/DocumentLayoutManager.cxx
@@ -453,8 +453,9 @@ SwFrameFormat *DocumentLayoutManager::CopyLayoutFormat(
{
SwNode* pAnchorNode = rNewAnchor.GetAnchorNode();
SwFormatFlyCnt aFormat( pDest );
- pAnchorNode->GetTextNode()->InsertItem(
- aFormat, rNewAnchor.GetAnchorContentOffset(), 0 );
+ assert(pAnchorNode->GetTextNode() && "sw.core: text node expected");
+ if (SwTextNode *pTextNd = pAnchorNode->GetTextNode())
+ pTextNd->InsertItem( aFormat, rNewAnchor.GetAnchorContentOffset(), 0 );
}
if( bMakeFrames )