diff options
author | Caolán McNamara <caolanm@redhat.com> | 2022-08-20 10:47:10 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2022-08-20 14:33:43 +0200 |
commit | c8f905fda1da4a3a58ab9bf4930cfaa7b7a04640 (patch) | |
tree | 7cb8fb315aba12cc791595ff34807148151c1b58 /editeng/source | |
parent | 77d8199f59b85f961088d8aec00d9d582b0df873 (diff) |
cid#1500500 Explicit null dereferenced
check like SvxUnoTextRangeEnumeration ctor does
Change-Id: I4dd4e08c72e9ad0f29afa2f88670f771dcb25b37
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138576
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'editeng/source')
-rw-r--r-- | editeng/source/uno/unotext2.cxx | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/editeng/source/uno/unotext2.cxx b/editeng/source/uno/unotext2.cxx index ca2a45baea1f..79706cad2d2e 100644 --- a/editeng/source/uno/unotext2.cxx +++ b/editeng/source/uno/unotext2.cxx @@ -47,6 +47,9 @@ SvxUnoTextContentEnumeration::SvxUnoTextContentEnumeration( const SvxUnoTextBase mpEditSource = rText.GetEditSource()->Clone(); mnNextParagraph = 0; + if (!mpEditSource) + return; + const SvxTextForwarder* pTextForwarder = rText.GetEditSource()->GetTextForwarder(); const sal_Int32 maxParaIndex = std::min( rSel.nEndPara + 1, pTextForwarder->GetParagraphCount() ); |