sw/source/core/docnode/node.cxx |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit e518624da1bdad5fcb24feb41349efa4301329e3
Author:     Xisco Fauli <xiscofa...@libreoffice.org>
AuthorDate: Tue May 23 12:39:50 2023 +0200
Commit:     Michael Stahl <michael.st...@allotropia.de>
CommitDate: Wed May 24 11:09:02 2023 +0200

    sw: fix crash in SwNode::GetFlyFormat()
    
    FindFlyFrame() might return nullptr
    See 
https://crashreport.libreoffice.org/stats/signature/SwNode::GetFlyFormat()
    
    Change-Id: Id99a806e62f03b8912747525c8b0235c1b23232b
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152156
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.st...@allotropia.de>

diff --git a/sw/source/core/docnode/node.cxx b/sw/source/core/docnode/node.cxx
index b69dec062a1f..64a9e86137c5 100644
--- a/sw/source/core/docnode/node.cxx
+++ b/sw/source/core/docnode/node.cxx
@@ -744,7 +744,7 @@ SwFrameFormat* SwNode::GetFlyFormat() const
         if( IsContentNode() )
         {
             SwContentFrame* pFrame = SwIterator<SwContentFrame, SwContentNode, 
sw::IteratorMode::UnwrapMulti>(*static_cast<const 
SwContentNode*>(this)).First();
-            if( pFrame )
+            if( pFrame && pFrame->FindFlyFrame())
                 pRet = pFrame->FindFlyFrame()->GetFormat();
         }
         if( !pRet )

Reply via email to