From c46f00166027fa3eefc75f9cb13bf4afc887bf1d Mon Sep 17 00:00:00 2001 From: Xisco Fauli Date: Fri, 25 Aug 2023 12:39:37 +0200 Subject: sc: fix crash in ScAttrDlg::PageCreated MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit See https://crashreport.libreoffice.org/stats/signature/ScAttrDlg::PageCreated(rtl::OString%20const%20&,SfxTabPage%20&) Change-Id: I3f89cc917648462f819eb35461055096a6eb3853 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156093 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- sc/source/ui/attrdlg/attrdlg.cxx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'sc/source/ui/attrdlg/attrdlg.cxx') diff --git a/sc/source/ui/attrdlg/attrdlg.cxx b/sc/source/ui/attrdlg/attrdlg.cxx index 7a80073d9da3..e09a69b5c13f 100644 --- a/sc/source/ui/attrdlg/attrdlg.cxx +++ b/sc/source/ui/attrdlg/attrdlg.cxx @@ -90,8 +90,11 @@ void ScAttrDlg::PageCreated(const OUString& rPageId, SfxTabPage& rTabPage) { const SfxPoolItem* pInfoItem = pDocSh->GetItem( SID_ATTR_CHAR_FONTLIST ); assert(pInfoItem && "FontListItem not found :-("); - aSet.Put (SvxFontListItem(static_cast(pInfoItem)->GetFontList(), SID_ATTR_CHAR_FONTLIST )); - rTabPage.PageCreated(aSet); + if (pInfoItem) + { + aSet.Put (SvxFontListItem(static_cast(pInfoItem)->GetFontList(), SID_ATTR_CHAR_FONTLIST )); + rTabPage.PageCreated(aSet); + } } else if (rPageId == "background") { -- cgit