From 1cccfb05d1aaea33aa370b6f4f080cae95611cd0 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Fri, 21 Oct 2022 14:18:26 +0100 Subject: cid#1516102 Dereference before null check MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- sw/source/core/doc/doctxm.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sw') 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) -- cgit v1.2.3