diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2023-03-03 16:29:17 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2023-03-04 20:49:41 +0000 |
commit | 9eb083ab732512c3ab64007c3be1c54be97172f6 (patch) | |
tree | 6f0fc7b2af7c2a1a25a5536670dec3c2e3d0bfb4 /sc | |
parent | 95ee8a692cbc3f8ead72e61eb36b9015f1c57605 (diff) |
check GetShell
it might return nullptr
Change-Id: I65b43d69f4757b6c331582ca2e256cdea01377af
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148194
Tested-by: Jenkins
Tested-by: Caolán McNamara <caolanm@redhat.com>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/view/tabvwshb.cxx | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sc/source/ui/view/tabvwshb.cxx b/sc/source/ui/view/tabvwshb.cxx index 11fba3153460..04c97bcea64f 100644 --- a/sc/source/ui/view/tabvwshb.cxx +++ b/sc/source/ui/view/tabvwshb.cxx @@ -712,6 +712,9 @@ bool ScTabViewShell::IsSignatureLineSigned() void ScTabViewShell::ExecuteUndo(SfxRequest& rReq) { SfxShell* pSh = GetViewData().GetDispatcher().GetShell(0); + if (!pSh) + return; + ScUndoManager* pUndoManager = static_cast<ScUndoManager*>(pSh->GetUndoManager()); const SfxItemSet* pReqArgs = rReq.GetArgs(); @@ -812,6 +815,9 @@ void ScTabViewShell::ExecuteUndo(SfxRequest& rReq) void ScTabViewShell::GetUndoState(SfxItemSet &rSet) { SfxShell* pSh = GetViewData().GetDispatcher().GetShell(0); + if (!pSh) + return; + SfxUndoManager* pUndoManager = pSh->GetUndoManager(); ScUndoManager* pScUndoManager = dynamic_cast<ScUndoManager*>(pUndoManager); |