summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2022-04-03 12:20:42 +0100
committerCaolán McNamara <caolanm@redhat.com>2022-04-03 16:20:14 +0200
commit24eb8731513e5a8b0b761cbd0dabd71ea7038c2d (patch)
tree082dc0cc4b49773e7b2e42dbbc0c39cad0600840 /sw
parent88f81a8df7483169592d106e4007d8810cb6ccfc (diff)
cid#1503360 Dereference null return value
Change-Id: I5c25149a9c2ec2938754de7f79991c93c741e914 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132478 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/doc/doctxm.cxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/sw/source/core/doc/doctxm.cxx b/sw/source/core/doc/doctxm.cxx
index 828742c0e37c..df997eb34a43 100644
--- a/sw/source/core/doc/doctxm.cxx
+++ b/sw/source/core/doc/doctxm.cxx
@@ -935,8 +935,9 @@ void SwTOXBaseSection::Update(const SfxItemSet* pAttr,
// find the first layout node for this TOX, if it only find the content
// in his own chapter
- const SwTextNode* pOwnChapterNode = IsFromChapter()
- ? ::lcl_FindChapterNode( *pSectNd, pLayout, pSectNd->FindSectionNode()->GetSectionLevel() + 1 )
+ const SwSectionNode* pChapterSectNd = IsFromChapter() ? pSectNd->FindSectionNode() : nullptr;
+ const SwTextNode* pOwnChapterNode = pChapterSectNd
+ ? ::lcl_FindChapterNode( *pSectNd, pLayout, pChapterSectNd->GetSectionLevel() + 1 )
: nullptr;
SwNode2LayoutSaveUpperFrames aN2L(*pSectNd);