sw/source/core/edit/edsect.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
New commits: commit aaa3b3e315d5c6b360ee7c9c32987ef9ddf92f41 Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Sat Aug 9 16:04:38 2025 +0100 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Mon Aug 11 12:09:10 2025 +0200 cid#1660818 Dereference null return value Change-Id: Iee0004db9ad48e8753c5570fe6c8ebc31b98fd1c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189263 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> (cherry picked from commit 39f512b4e384b39730a637392ff48897eee21331) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189292 Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> diff --git a/sw/source/core/edit/edsect.cxx b/sw/source/core/edit/edsect.cxx index 8059a313f3ac..9175faf92bc6 100644 --- a/sw/source/core/edit/edsect.cxx +++ b/sw/source/core/edit/edsect.cxx @@ -338,7 +338,7 @@ static const SwNode* lcl_SpecialInsertNode(const SwPosition* pCurrentPos) } if(pInnermostNode != nullptr) { - bool bIsProtected = pInnermostNode->IsProtect(); + bool bCanModify = !pInnermostNode->IsProtect(); //special case - ToxSection // - in this case the inner section could be tox header @@ -354,7 +354,7 @@ static const SwNode* lcl_SpecialInsertNode(const SwPosition* pCurrentPos) if (const SwSection* pSectionParent = pSection->GetParent()) pInnermostNode = pSectionParent->GetFormat()->GetSectionNode(); } - bIsProtected = static_cast<const SwSectionNode*>(pInnermostNode)->IsInProtectSect(); + bCanModify = pInnermostNode && !static_cast<const SwSectionNode*>(pInnermostNode)->IsInProtectSect(); } // The previous version had a check to skip empty read-only sections. Those @@ -362,7 +362,7 @@ static const SwNode* lcl_SpecialInsertNode(const SwPosition* pCurrentPos) // inside a protected area. // Now, pInnermostNode is NULL or the innermost section or table node. - if(!bIsProtected) + if (bCanModify) { OSL_ENSURE( pInnermostNode->IsTableNode() || pInnermostNode->IsSectionNode(), "wrong node found" );