sw/source/core/layout/findfrm.cxx |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

New commits:
commit 9fdb9c5fd71e61ae673c79064e3249ce7207031a
Author:     Attila Szűcs <szucs.atti...@nisz.hu>
AuthorDate: Fri Nov 12 11:30:42 2021 +0100
Commit:     László Németh <nem...@numbertext.org>
CommitDate: Fri Nov 12 15:43:02 2021 +0100

    tdf#145611 sw: fix regression: undoing page breaks
    
    at pages with endnotes.
    
    Added a nullptr check for section to avoid crash on Linux.
    It seems, SwSectionFrame::m_pSection can be nullptr at that point.
    
    Regression from commit 4c31b4ef2083087a822c3ae648fd09acc67d2f88
    "tdf#139336 sw: fix extra pages of multicolumn sections with footnotes".
    
    Co-authored-by: Tibor Nagy (NISZ)
    
    Change-Id: Iec4ff93df6720d0e62af59117cd03bd3902c0f64
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125095
    Tested-by: László Németh <nem...@numbertext.org>
    Reviewed-by: László Németh <nem...@numbertext.org>

diff --git a/sw/source/core/layout/findfrm.cxx 
b/sw/source/core/layout/findfrm.cxx
index 1eae79d9cd60..52d7e9627a1e 100644
--- a/sw/source/core/layout/findfrm.cxx
+++ b/sw/source/core/layout/findfrm.cxx
@@ -459,9 +459,12 @@ SwFootnoteBossFrame* SwFrame::FindFootnoteBossFrame( bool 
bFootnotes )
     bool bMoveToPageFrame = false;
     if (pSectframe)
     {
-        bool bNoBalance = 
pSectframe->GetSection()->GetFormat()->GetBalancedColumns().GetValue();
-        bool bFAtEnd = pSectframe->IsFootnoteAtEnd();
-        bMoveToPageFrame = !bFAtEnd && !bNoBalance;
+        SwSection* pSect = pSectframe->GetSection();
+        if (pSect) {
+            bool bNoBalance = 
pSect->GetFormat()->GetBalancedColumns().GetValue();
+            bool bFAtEnd = pSectframe->IsFootnoteAtEnd();
+            bMoveToPageFrame = !bFAtEnd && !bNoBalance;
+        }
     }
     while (pRet
            && ((!bMoveToPageFrame && !pRet->IsFootnoteBossFrame())

Reply via email to