summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2023-03-16 16:26:17 +0100
committerChristian Lohmaier <lohmaier+LibreOffice@googlemail.com>2023-03-24 16:23:36 +0000
commitace3079172ed55d7408193a2f37bc9b16d1b3c39 (patch)
tree06eacc3fafb062699773e8c9f953b4e342f2a7c1 /sw
parent07c77bc32e1e34f882ced16ba6bfac83def8689a (diff)
sw: fix null dereference
See https://crashreport.libreoffice.org/stats/signature/SfxDispatcher::ExecuteList(unsigned%20short,SfxCallMode,std::initializer_list%3CSfxPoolItem%20const%20*%3E,std::initializer_list%3CSfxPoolItem%20const%20*%3E) Change-Id: I7f5471f003798f260d9d015782bd2a798baa22d2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148999 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org> (cherry picked from commit 11ce7e810ef5ba540afe676d58575fabf4ab386d) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149018 Reviewed-by: Michael Stahl <michael.stahl@allotropia.de> (cherry picked from commit b524e2fcb52a28bd24854c23a8f5eedf10d9552e) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149099 Tested-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/uibase/app/docsh2.cxx11
1 files changed, 6 insertions, 5 deletions
diff --git a/sw/source/uibase/app/docsh2.cxx b/sw/source/uibase/app/docsh2.cxx
index bc9647d77dd7..d8195b7e200d 100644
--- a/sw/source/uibase/app/docsh2.cxx
+++ b/sw/source/uibase/app/docsh2.cxx
@@ -1197,11 +1197,12 @@ void SwDocShell::Execute(SfxRequest& rReq)
// Ok. I did my best.
break;
- SfxStringItem aApp(SID_DOC_SERVICE, "com.sun.star.text.TextDocument");
- SfxStringItem aTarget(SID_TARGETNAME, "_blank");
- pViewShell->GetDispatcher()->ExecuteList(SID_OPENDOC,
- SfxCallMode::API|SfxCallMode::SYNCHRON,
- { &aApp, &aTarget });
+ if (SfxDispatcher* pDispatch = pViewShell->GetDispatcher())
+ {
+ SfxStringItem aApp(SID_DOC_SERVICE, "com.sun.star.text.TextDocument");
+ SfxStringItem aTarget(SID_TARGETNAME, "_blank");
+ pDispatch->ExecuteList(SID_OPENDOC, SfxCallMode::API|SfxCallMode::SYNCHRON, { &aApp, &aTarget });
+ }
}
break;
case SID_CLASSIFICATION_APPLY: