diff options
author | Patrick Luby <plubius@libreoffice.org> | 2024-01-13 17:57:56 -0500 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2024-01-22 13:11:32 +0100 |
commit | 52e959efc36edaf3e5bd1cd8ad75d4541f861390 (patch) | |
tree | fb5d65a33e7c8e8db5273be7a82535668c691c7f /sw | |
parent | 2e65401cf50ca25e16a0f3d4b624e2b48c97644c (diff) |
tdf#159025 skip undo if SwTableNode is a nullptr
I don't know what causes the SwTableNode to be a nullptr in the
case of tdf#159025, but at least stop the crashing by skipping
this undo request.
Change-Id: Idad1ed290af215e591018ea58732b77ca504ba01
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162031
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Reviewed-by: Patrick Luby <plubius@libreoffice.org>
(cherry picked from commit f414c61f8dd2617baa0851525b8a7a630c5e34da)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162228
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/undo/untbl.cxx | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/sw/source/core/undo/untbl.cxx b/sw/source/core/undo/untbl.cxx index 3092df0c2fd3..8da85452c7d9 100644 --- a/sw/source/core/undo/untbl.cxx +++ b/sw/source/core/undo/untbl.cxx @@ -272,7 +272,14 @@ void SwUndoInsTable::UndoImpl(::sw::UndoRedoContext & rContext) SwNodeIndex aIdx( rDoc.GetNodes(), m_nStartNode ); SwTableNode* pTableNd = aIdx.GetNode().GetTableNode(); - OSL_ENSURE( pTableNd, "no TableNode" ); + // tdf#159025 skip undo if SwTableNode is a nullptr + // I don't know what causes the SwTableNode to be a nullptr in the + // case of tdf#159025, but at least stop the crashing by skipping + // this undo request. + SAL_WARN_IF( !pTableNd, "sw.core", "no TableNode" ); + if( !pTableNd ) + return; + pTableNd->DelFrames(); if( IDocumentRedlineAccess::IsRedlineOn( GetRedlineFlags() )) |