summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2024-05-23 15:41:43 +0200
committerAndras Timar <andras.timar@collabora.com>2024-06-03 14:31:33 +0200
commitc20d57101217a31ff62fa33b06da8e7fe7038b45 (patch)
tree340fd9c453129de3b6574d62dc5b411fd1b249b3 /sc
parentdfc1586d2b66f063dc5c6a21d70f7e1aeb38c50c (diff)
sc: warning C6011: Dereferencing NULL pointer
Change-Id: Ib6535d167ec741ea0641208d01f01bee334c0e79 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167992 Reviewed-by: Xisco Fauli <xiscofauli@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.mcnamara@collabora.com>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/docshell/dbdocfun.cxx2
-rw-r--r--sc/source/ui/docshell/docfunc.cxx2
2 files changed, 2 insertions, 2 deletions
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 0d3d68654cea..7647ea91a988 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);