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

New commits:
commit 07674a32af695801e0f69fedd685680ccbe5ab6f
Author:     Michael Stahl <[email protected]>
AuthorDate: Fri Oct 10 16:44:14 2025 +0200
Commit:     Michael Stahl <[email protected]>
CommitDate: Mon Oct 13 11:04:51 2025 +0200

    tdf#51850 sw: fix a nullpointer crash
    
    lcl_PasteFlyOrDrawFormat() may return nullptr, causing testTdf155028 to
    crash in older release branch.
    
    (regression from commit d072b5e09e1c7f759c797b7ba1ee89a3bfef8858)
    
    Change-Id: I68549648aef2c9d58919f4d26415834d0784eeef
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192173
    Reviewed-by: Michael Stahl <[email protected]>
    Tested-by: Jenkins

diff --git a/sw/source/core/frmedt/fecopy.cxx b/sw/source/core/frmedt/fecopy.cxx
index c0ee3c3f6e1c..ee28fb587a26 100644
--- a/sw/source/core/frmedt/fecopy.cxx
+++ b/sw/source/core/frmedt/fecopy.cxx
@@ -1079,7 +1079,7 @@ SwFEShell::Paste(SwDoc& rClpDoc, bool const bNestedTable)
                 {
                     lcl_InitSelectFlyOrDrawFormat(pFlyFormat, *this, isSelect);
                 }
-                if (isSelect && inserted.size() == 1)
+                if (isSelect && inserted.size() == 1 && inserted.front())
                 {
                     if (inserted.front()->Which() == RES_FLYFRMFMT
                         && 
GetDoc()->GetNodes()[inserted.front()->GetContent().GetContentIdx()->GetIndex() 
+ 1]->IsGrfNode())

Reply via email to