diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2022-12-15 17:20:20 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2022-12-15 19:36:17 +0000 |
commit | f9c857563f2a8837c6ec83851369badbcfa22185 (patch) | |
tree | 6146e79b6056a896bc1b7421608ebf8d28496042 /sd/source/ui/view/unmodpg.cxx | |
parent | a0c24199e4905c8220fb4254dfd0b263a44626a7 (diff) |
sd: fix null deref in ModifyPageUndoAction::Undo/Redo
See https://crashreport.libreoffice.org/stats/signature/SfxViewFrame::GetDispatcher()
Change-Id: Iaf14ad8fd5dab878ea5e3d6997371c2d8a4beac6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144241
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Jenkins
Diffstat (limited to 'sd/source/ui/view/unmodpg.cxx')
-rw-r--r-- | sd/source/ui/view/unmodpg.cxx | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/sd/source/ui/view/unmodpg.cxx b/sd/source/ui/view/unmodpg.cxx index 2fdfbd13a9bb..afd454a5f183 100644 --- a/sd/source/ui/view/unmodpg.cxx +++ b/sd/source/ui/view/unmodpg.cxx @@ -118,8 +118,12 @@ void ModifyPageUndoAction::Undo() } // Redisplay - SfxViewFrame::Current()->GetDispatcher()->Execute( - SID_SWITCHPAGE, SfxCallMode::ASYNCHRON | SfxCallMode::RECORD ); + SfxViewFrame* pCurrent = SfxViewFrame::Current(); + if( pCurrent ) + { + pCurrent->GetDispatcher()->Execute( + SID_SWITCHPAGE, SfxCallMode::ASYNCHRON | SfxCallMode::RECORD ); + } } void ModifyPageUndoAction::Redo() @@ -161,8 +165,12 @@ void ModifyPageUndoAction::Redo() } // Redisplay - SfxViewFrame::Current()->GetDispatcher()->Execute( - SID_SWITCHPAGE, SfxCallMode::ASYNCHRON | SfxCallMode::RECORD ); + SfxViewFrame* pCurrent = SfxViewFrame::Current(); + if( pCurrent ) + { + pCurrent->GetDispatcher()->Execute( + SID_SWITCHPAGE, SfxCallMode::ASYNCHRON | SfxCallMode::RECORD ); + } } ModifyPageUndoAction::~ModifyPageUndoAction() |