summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2022-10-21 14:18:26 +0100
committerCaolán McNamara <caolanm@redhat.com>2022-10-21 17:34:44 +0200
commit1cccfb05d1aaea33aa370b6f4f080cae95611cd0 (patch)
treed51376c6a0cc4a727ee998148aa0633a51763d9e /sw
parent4668bfe4f64acfb17da5efbb759407664b407d81 (diff)
cid#1516102 Dereference before null check
since... commit ba58fc11723b7c9d370d6407385ea0e8829db099 Date: Thu Oct 13 22:11:35 2022 +0200 tdf#151462 - Search for outline node containing the current node Change-Id: Ib0bc51b1c37cb4bc60e61800a2d190eee2b6aa61 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141629 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/doc/doctxm.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/sw/source/core/doc/doctxm.cxx b/sw/source/core/doc/doctxm.cxx
index 09c44f1ef489..5578a503dcfd 100644
--- a/sw/source/core/doc/doctxm.cxx
+++ b/sw/source/core/doc/doctxm.cxx
@@ -734,10 +734,10 @@ static const SwTextNode* lcl_FindChapterNode( const SwNode& rNd,
pNd = GetBodyTextNode( pNd->GetDoc(), aPos, *pFrame );
OSL_ENSURE( pNd, "Where's the paragraph?" );
// tdf#151462 - search for outline node containing the current node
- return pNd->FindOutlineNodeOfLevel(pNd->GetSectionLevel() - 1, pLayout);
+ return pNd ? pNd->FindOutlineNodeOfLevel(pNd->GetSectionLevel() - 1, pLayout) : nullptr;
}
}
- return pNd ? pNd->FindOutlineNodeOfLevel(nLvl, pLayout) : nullptr;
+ return pNd->FindOutlineNodeOfLevel(nLvl, pLayout);
}
static bool IsHeadingContained(const SwTextNode* pChptrNd, const SwNode& rNd)