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
This commit is contained in:
Xisco Fauli 2022-12-15 17:20:20 +01:00 committed by Caolán McNamara
parent a0c24199e4
commit f9c857563f

View file

@ -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()