summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2023-03-16 16:26:17 +0100
committerKevin Suo <suokunlong@126.com>2023-03-20 09:51:46 +0800
commit1b33ec542c1a584f0eb2a1df662fc1bfcac2e012 (patch)
tree20da02f784709ee05eb69cd25ebe06b486f9ccff
parent4d331042fb89e401f7e544bbf87ef4e7cc67f658 (diff)
sw: fix null dereference distro/CN/libreoffice-7-4-LTS
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/+/149019 (cherry picked from commit 1b93a30a113e45cbf67b0683e233568e40446deb)
-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 e5b7b63c43d0..83ea01b75b91 100644
--- a/sw/source/uibase/app/docsh2.cxx
+++ b/sw/source/uibase/app/docsh2.cxx
@@ -1185,11 +1185,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: