summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2022-05-22 12:05:15 +0100
committerCaolán McNamara <caolanm@redhat.com>2022-05-22 14:35:25 +0200
commit66d7ed084a676ff7803a3c7672e80d9f7ca0e74e (patch)
treef38db45e660c5a7485d7be5a98671a83569d197d /sc
parent7dcab55d97713b48b003e20590ebd51c77b60391 (diff)
cid#1504540 Dereference before null check
Change-Id: Ia47b6dd5d1524bd377670815a342d0ee478f823e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134725 Tested-by: Caolán McNamara <caolanm@redhat.com> 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 4645ec111d68..822a0cf59b46 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -4124,8 +4124,8 @@ sal_Bool SAL_CALL ScTableColumnsObj::hasByName( const OUString& aName )
{
SolarMutexGuard aGuard;
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 true;
return false; // not found