summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2023-05-18 15:24:56 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2023-05-19 09:18:41 +0200
commit9efbcce8b3f6f40a2687b9e4892527b6974227b7 (patch)
treee660d78f722af1299b9a2b295e3922cda0b1a212
parent85c0bf2e6d851ca53dc200c7c36c4419115636b9 (diff)
prevent crash in mail merge
seen reports in crashreporter Change-Id: I10ecac363eea0292f9dc257769da6d060dc350f9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151962 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--sw/source/ui/dbui/mmresultdialogs.cxx6
1 files changed, 6 insertions, 0 deletions
diff --git a/sw/source/ui/dbui/mmresultdialogs.cxx b/sw/source/ui/dbui/mmresultdialogs.cxx
index f7c17f18c4ca..55e6d3ed899c 100644
--- a/sw/source/ui/dbui/mmresultdialogs.cxx
+++ b/sw/source/ui/dbui/mmresultdialogs.cxx
@@ -893,6 +893,12 @@ IMPL_LINK(SwMMResultEmailDialog, SendTypeHdl_Impl, weld::ComboBox&, rBox, void)
IMPL_LINK_NOARG(SwMMResultEmailDialog, SendAsHdl_Impl, weld::Button&, void)
{
+ // work around crash when calling constructor with no active view
+ if (!GetActiveView())
+ {
+ SAL_WARN("sw", "ignoring SendAs button click, because no active view");
+ return;
+ }
SwMailBodyDialog aDlg(m_xDialog.get());
aDlg.SetBody(m_sBody);
if (RET_OK == aDlg.run())