diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2023-07-04 14:23:20 +0200 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2023-07-08 20:36:30 +0200 |
commit | 07e6ab12030e08398bc9a67ddf2ea8027b2feba1 (patch) | |
tree | 2250488a6e5ccfa15c453f33fd02614835cbd87b /sfx2 | |
parent | dcf981d496e9ba46b3e84e7b963bb7ad92c669cb (diff) |
sfx2: fix crash in SfxViewShell::StartPrint
See https://crashreport.libreoffice.org/stats/signature/SfxViewShell::StartPrint(com::sun::star::uno::Sequence%3Ccom::sun::star::beans::PropertyValue%3E%20const%20&,bool,bool)
Change-Id: I3d10414d4cfd027bf80ceaf6692bb7f92269f6c9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153965
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
(cherry picked from commit 3502f5147b9102d37459c373ee07e052fd267db7)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153990
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/view/viewprn.cxx | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sfx2/source/view/viewprn.cxx b/sfx2/source/view/viewprn.cxx index 9476dd22edec..885f1bb31346 100644 --- a/sfx2/source/view/viewprn.cxx +++ b/sfx2/source/view/viewprn.cxx @@ -609,8 +609,11 @@ void SfxViewShell::StartPrint( const uno::Sequence < beans::PropertyValue >& rPr css::beans::PropertyValue* pJobNameVal = xNewController->getValue("JobName"); if (!pJobNameVal) { - xNewController->setValue("JobName", Any(GetObjectShell()->GetTitle(1))); - xNewController->setPrinterModified(mbPrinterSettingsModified); + if (SfxObjectShell* pDoc = GetObjectShell()) + { + xNewController->setValue("JobName", Any(pDoc->GetTitle(1))); + xNewController->setPrinterModified(mbPrinterSettingsModified); + } } } |