sw/source/core/doc/doctxm.cxx | 3 +++ 1 file changed, 3 insertions(+) New commits: commit 4496049d2514e1be47030adb4b4c339ebd8287b2 Author: Xisco Fauli <xiscofa...@libreoffice.org> AuthorDate: Mon Nov 11 14:02:49 2024 +0100 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Mon Nov 11 20:54:27 2024 +0100
sw: Dereference before null check Since commit 2a2c4dddf51c0d6ab726a8854123887bbfa7792a Author: Andreas Heinisch <andreas.heini...@yahoo.de> Date: Tue Oct 29 12:11:41 2024 +0100 tdf#153636 - Search for outline node only if index is for the current chapter Change-Id: If969db7c4eee4c542ff99f9d405aa7f1d2a8f414 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176403 Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> Tested-by: Jenkins Reviewed-by: Andreas Heinisch <andreas.heini...@yahoo.de> (cherry picked from commit b350937ef36056b2f894063b2bef0362b0ad3091) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176411 diff --git a/sw/source/core/doc/doctxm.cxx b/sw/source/core/doc/doctxm.cxx index 75a3cbb26822..4463bdc7c29b 100644 --- a/sw/source/core/doc/doctxm.cxx +++ b/sw/source/core/doc/doctxm.cxx @@ -736,6 +736,9 @@ static const SwTextNode* lcl_FindChapterNode(const SwNode& rNd, SwRootFrame cons SwPosition aPos( *pNd ); pNd = GetBodyTextNode( pNd->GetDoc(), aPos, *pFrame ); OSL_ENSURE( pNd, "Where's the paragraph?" ); + if (!pNd) + return nullptr; + // tdf#153636 - search for outline node only if the index is for the current chapter if (bIsFromChapter) // tdf#151462 - search for outline node containing the current node