diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2023-05-19 16:12:18 +0200 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2023-05-28 20:58:16 +0200 |
commit | 92e70381fcb491f1e4baa5b616d0883aee441e81 (patch) | |
tree | 376deea5d1432f01fda3af0079447fff8f10b5ff /sw | |
parent | 3bb54c5ba9bf267bfca043043da487d8446f559f (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
(cherry picked from commit 77bc0d1d7c0b895d089fa7ac2f7ca5221345b71a)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152102
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/doc/DocumentLayoutManager.cxx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sw/source/core/doc/DocumentLayoutManager.cxx b/sw/source/core/doc/DocumentLayoutManager.cxx index e0366bdd3a0b..75c8e86acdb2 100644 --- a/sw/source/core/doc/DocumentLayoutManager.cxx +++ b/sw/source/core/doc/DocumentLayoutManager.cxx @@ -454,8 +454,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 ) |