summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2023-03-03 16:29:17 +0100
committerCaolán McNamara <caolanm@redhat.com>2023-03-07 16:48:44 +0000
commitbd323bb9554265ec093fed3274cb232fbf0cd2ec (patch)
tree1b949c25ed8b63de52f6c5f22cf2775a88367b6a /sc
parentebc60f5ccab910d6974b5c386b2c0243f9eb030b (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> (cherry picked from commit 9eb083ab732512c3ab64007c3be1c54be97172f6) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148231
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/view/tabvwshb.cxx6
1 files changed, 6 insertions, 0 deletions
diff --git a/sc/source/ui/view/tabvwshb.cxx b/sc/source/ui/view/tabvwshb.cxx
index d718a2e2cd00..6d7d89421d09 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);