sc/source/ui/docshell/dbdocfun.cxx |    2 +-
 sc/source/ui/docshell/docfunc.cxx  |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit bcbe3c31aa9166c853a24ea49184e0493a97f6c6
Author:     Xisco Fauli <xiscofa...@libreoffice.org>
AuthorDate: Thu May 23 15:41:43 2024 +0200
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Sun May 26 20:21:41 2024 +0200

    sc: warning C6011: Dereferencing NULL pointer
    
    Change-Id: Ib6535d167ec741ea0641208d01f01bee334c0e79
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167992
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>
    Tested-by: Jenkins
    (cherry picked from commit 64b14cc6ab688abbea2f87bc25ba42159b5dc904)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167942
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>

diff --git a/sc/source/ui/docshell/dbdocfun.cxx 
b/sc/source/ui/docshell/dbdocfun.cxx
index ee59f36232ae..204854b09764 100644
--- a/sc/source/ui/docshell/dbdocfun.cxx
+++ b/sc/source/ui/docshell/dbdocfun.cxx
@@ -630,7 +630,7 @@ bool ScDBDocFunc::Sort( SCTAB nTab, const ScSortParam& 
rSortParam,
         while (pViewShell)
         {
             ScTabViewShell* pTabViewShell = 
dynamic_cast<ScTabViewShell*>(pViewShell);
-            if (pTabViewShell && pTabViewShell->GetDocId() == 
pSomeViewForThisDoc->GetDocId())
+            if (pTabViewShell && pSomeViewForThisDoc && 
pTabViewShell->GetDocId() == pSomeViewForThisDoc->GetDocId())
             {
                 if (ScPositionHelper* pPosHelper = 
pTabViewShell->GetViewData().GetLOKHeightHelper(nTab))
                     pPosHelper->invalidateByIndex(nStartRow);
diff --git a/sc/source/ui/docshell/docfunc.cxx 
b/sc/source/ui/docshell/docfunc.cxx
index d67e6efa66cb..9f7bbbe58ce2 100644
--- a/sc/source/ui/docshell/docfunc.cxx
+++ b/sc/source/ui/docshell/docfunc.cxx
@@ -180,7 +180,7 @@ bool ScDocFunc::AdjustRowHeight( const ScRange& rRange, 
bool bPaint, bool bApi )
             while (pViewShell)
             {
                 ScTabViewShell* pTabViewShell = 
dynamic_cast<ScTabViewShell*>(pViewShell);
-                if (pTabViewShell && pTabViewShell->GetDocId() == 
pSomeViewForThisDoc->GetDocId())
+                if (pTabViewShell && pSomeViewForThisDoc && 
pTabViewShell->GetDocId() == pSomeViewForThisDoc->GetDocId())
                 {
                     if (ScPositionHelper* pPosHelper = 
pTabViewShell->GetViewData().GetLOKHeightHelper(nTab))
                         pPosHelper->invalidateByIndex(nStartRow);

Reply via email to