sfx2/source/view/viewprn.cxx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
New commits: commit b88b9504503298996de1feaa3f86b1adf36563a2 Author: Xisco Fauli <xiscofa...@libreoffice.org> AuthorDate: Tue Jul 4 14:23:20 2023 +0200 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Tue Jul 4 16:24:31 2023 +0200 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.mcnam...@collabora.com> Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> diff --git a/sfx2/source/view/viewprn.cxx b/sfx2/source/view/viewprn.cxx index 5add9956abcb..5ada786ba108 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); + } } }