summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2022-05-22 12:06:36 +0100
committerCaolán McNamara <caolanm@redhat.com>2022-05-22 14:35:37 +0200
commit8cdfc82557cf1256aaa3e1e8200d1b2ce9f16608 (patch)
tree584a300a3e6fe5cfc3568a6bafdad69eb68ca69e /sc
parent66d7ed084a676ff7803a3c7672e80d9f7ca0e74e (diff)
cid#1504534 Dereference before null check
Change-Id: I7deb272cbf7105b78911acb4b17bc3f078913a2a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134726 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/unoobj/docuno.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index 822a0cf59b46..79e51e44f633 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -4015,8 +4015,8 @@ rtl::Reference<ScTableColumnObj> ScTableColumnsObj::GetObjectByIndex_Impl(sal_In
rtl::Reference<ScTableColumnObj> ScTableColumnsObj::GetObjectByName_Impl(const OUString& aName) const
{
SCCOL nCol = 0;
- if ( ::AlphaToCol( pDocShell->GetDocument(), nCol, aName) )
- if ( pDocShell && nCol >= nStartCol && nCol <= nEndCol )
+ if (pDocShell && ::AlphaToCol(pDocShell->GetDocument(), nCol, aName))
+ if (nCol >= nStartCol && nCol <= nEndCol)
return new ScTableColumnObj( pDocShell, nCol, nTab );
return nullptr;