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 <nemeth@numbertext.org>
Reviewed-by: László Németh <nemeth@numbertext.org>
diff --git a/sw/source/core/layout/findfrm.cxx b/sw/source/core/layout/findfrm.cxx
index 1eae79d9..52d7e96 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())