sw/source/ui/dbui/mmresultdialogs.cxx |    6 ++++++
 1 file changed, 6 insertions(+)

New commits:
commit 9efbcce8b3f6f40a2687b9e4892527b6974227b7
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Thu May 18 15:24:56 2023 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Fri May 19 09:18:41 2023 +0200

    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.gran...@collabora.co.uk>

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())

Reply via email to