summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-12-11 09:03:51 +0000
committerAndras Timar <andras.timar@collabora.com>2021-07-11 13:44:02 +0200
commit0a018ee6376003e255c369922e6a67e11b556cd6 (patch)
tree367e2514313245a1497b9701ab87ea9053044d06 /sw
parent7f219cef50ba61f97444d6cdb46d32f780156500 (diff)
cid#1470585 Dereference null return value
Change-Id: If2a3eae843753a06d2f3fa9ac31acc9470cb6982 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107584 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit 2c0930f19e269348a2aadc0ffe69ff23d04d7cc1) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118616 Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/edit/edtab.cxx10
1 files changed, 6 insertions, 4 deletions
diff --git a/sw/source/core/edit/edtab.cxx b/sw/source/core/edit/edtab.cxx
index b598e4754a70..03e951e2509c 100644
--- a/sw/source/core/edit/edtab.cxx
+++ b/sw/source/core/edit/edtab.cxx
@@ -148,17 +148,19 @@ bool SwEditShell::TextToTable( const SwInsertTableOptions& rInsTableOpts,
bool SwEditShell::TableToText( sal_Unicode cCh )
{
SwWait aWait( *GetDoc()->GetDocShell(), true );
- bool bRet = false;
SwPaM* pCursor = GetCursor();
const SwTableNode* pTableNd =
GetDoc()->IsIdxInTable( pCursor->GetPoint()->nNode );
+ if (!pTableNd)
+ return false;
+
if( IsTableMode() )
{
ClearMark();
pCursor = GetCursor();
}
- else if( !pTableNd || pCursor->GetNext() != pCursor )
- return bRet;
+ else if (pCursor->GetNext() != pCursor)
+ return false;
// TL_CHART2:
// tell the charts about the table to be deleted and have them use their own data
@@ -177,7 +179,7 @@ bool SwEditShell::TableToText( sal_Unicode cCh )
//Modified for bug #i119954# Application crashed if undo/redo convert nest table to text
StartUndo();
- bRet = ConvertTableToText( pTableNd, cCh );
+ bool bRet = ConvertTableToText( pTableNd, cCh );
EndUndo();
//End for bug #i119954#
pCursor->GetPoint()->nNode = aTabIdx;