sc/source/ui/docshell/dbdocfun.cxx |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 4677345e3695bac158bb04048b4d5c608ed764b4
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Fri Jul 30 11:16:04 2021 +0100
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Fri Jul 30 21:01:16 2021 +0200

    cid#1489568 Dereference null return value
    
    Change-Id: I1e200d119c1b12266e69c21c2b94e83c1943b84d
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119703
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

diff --git a/sc/source/ui/docshell/dbdocfun.cxx 
b/sc/source/ui/docshell/dbdocfun.cxx
index 3cdee27ffb1d..6c374e1b09a3 100644
--- a/sc/source/ui/docshell/dbdocfun.cxx
+++ b/sc/source/ui/docshell/dbdocfun.cxx
@@ -602,7 +602,8 @@ bool ScDBDocFunc::Sort( SCTAB nTab, const ScSortParam& 
rSortParam,
             ScTabViewShell* pTabViewShell = 
dynamic_cast<ScTabViewShell*>(pViewShell);
             if (pTabViewShell && pTabViewShell->GetDocId() == 
pSomeViewForThisDoc->GetDocId())
             {
-                
pTabViewShell->GetViewData().GetLOKHeightHelper(nTab)->invalidateByIndex(nStartRow);
+                if (ScPositionHelper* pPosHelper = 
pTabViewShell->GetViewData().GetLOKHeightHelper(nTab))
+                    pPosHelper->invalidateByIndex(nStartRow);
             }
             pViewShell = SfxViewShell::GetNext(*pViewShell);
         }

Reply via email to