diff options
author | Caolán McNamara <caolanm@redhat.com> | 2020-12-11 09:03:51 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2020-12-11 11:41:37 +0100 |
commit | 2c0930f19e269348a2aadc0ffe69ff23d04d7cc1 (patch) | |
tree | f287a3250907da72efa2c8e7d81de8b505da24a5 /sw | |
parent | fcdd461a54a7b5703067690da8b4676321b24125 (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>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/edit/edtab.cxx | 10 |
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; |