sw/source/core/layout/sectfrm.cxx |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 35dbbcefb2a31c211a879eb7d5cdd267dd763ccc
Author:     Mike Kaganski <mike.kagan...@collabora.com>
AuthorDate: Sat Nov 2 14:23:34 2024 +0500
Commit:     Mike Kaganski <mike.kagan...@collabora.com>
CommitDate: Sat Nov 2 11:40:58 2024 +0100

    Fix unchecked dereference
    
    After commit 0c96119895b347f8eb5bb89f393351bd3c02b9f1
    ("tdf#159565 prerequisite: make hidden sections have
    zero-height frames", 2024-02-15).
    
    Change-Id: Ie990dcaf519329382b5088f31e6f534445470229
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175944
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com>

diff --git a/sw/source/core/layout/sectfrm.cxx 
b/sw/source/core/layout/sectfrm.cxx
index 92d1e1bde1b5..11245f084a92 100644
--- a/sw/source/core/layout/sectfrm.cxx
+++ b/sw/source/core/layout/sectfrm.cxx
@@ -2252,7 +2252,8 @@ bool SwSectionFrame::Growable() const
 
 SwTwips SwSectionFrame::Grow_(SwTwips nDist, SwResizeLimitReason& reason, bool 
bTst)
 {
-    if (GetSection()->CalcHiddenFlag())
+    SwSection* pSection = GetSection();
+    if (pSection && pSection->CalcHiddenFlag())
     {
         reason = SwResizeLimitReason::Unspecified;
         return 0;
@@ -2279,7 +2280,6 @@ SwTwips SwSectionFrame::Grow_(SwTwips nDist, 
SwResizeLimitReason& reason, bool b
     bool bGrow = !Lower() || !Lower()->IsColumnFrame() || !Lower()->GetNext();
     if (!bGrow)
     {
-        SwSection* pSection = GetSection();
         bGrow = pSection && 
pSection->GetFormat()->GetBalancedColumns().GetValue();
         if (!bGrow && nOrigDist)
             reason = SwResizeLimitReason::BalancedColumns;

Reply via email to