summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2024-11-11 14:02:49 +0100
committerXisco Fauli <xiscofauli@libreoffice.org>2024-11-11 20:54:27 +0100
commit4496049d2514e1be47030adb4b4c339ebd8287b2 (patch)
tree1da18f89065d79e9a862ea8acb2380d8ec04de3d /sw
parent5b864851f6c1c88674b6c2ad07215d62249f47ac (diff)
sw: Dereference before null check
Since commit 2a2c4dddf51c0d6ab726a8854123887bbfa7792a Author: Andreas Heinisch <andreas.heinisch@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 <xiscofauli@libreoffice.org> Tested-by: Jenkins Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de> (cherry picked from commit b350937ef36056b2f894063b2bef0362b0ad3091) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176411
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/doc/doctxm.cxx3
1 files changed, 3 insertions, 0 deletions
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