sc/source/ui/attrdlg/attrdlg.cxx |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

New commits:
commit f0f51d05f27d7a1ed31b3b9d304170f7c951f5ac
Author:     Xisco Fauli <xiscofa...@libreoffice.org>
AuthorDate: Fri Aug 25 12:39:37 2023 +0200
Commit:     Christian Lohmaier <lohmaier+libreoff...@googlemail.com>
CommitDate: Wed Aug 30 15:49:40 2023 +0200

    sc: fix crash in ScAttrDlg::PageCreated
    
    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 <caolan.mcnam...@collabora.com>
    Tested-by: Caolán McNamara <caolan.mcnam...@collabora.com>
    (cherry picked from commit c46f00166027fa3eefc75f9cb13bf4afc887bf1d)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156004
    Tested-by: Jenkins
    Reviewed-by: Christian Lohmaier <lohmaier+libreoff...@googlemail.com>

diff --git a/sc/source/ui/attrdlg/attrdlg.cxx b/sc/source/ui/attrdlg/attrdlg.cxx
index 734ae94d606f..3f307adddeb4 100644
--- a/sc/source/ui/attrdlg/attrdlg.cxx
+++ b/sc/source/ui/attrdlg/attrdlg.cxx
@@ -76,8 +76,11 @@ void ScAttrDlg::PageCreated(const OString& rPageId, 
SfxTabPage& rTabPage)
     {
         const SfxPoolItem* pInfoItem = pDocSh->GetItem( SID_ATTR_CHAR_FONTLIST 
);
         assert(pInfoItem && "FontListItem  not found :-(");
-        aSet.Put (SvxFontListItem(static_cast<const 
SvxFontListItem*>(pInfoItem)->GetFontList(), SID_ATTR_CHAR_FONTLIST ));
-        rTabPage.PageCreated(aSet);
+        if (pInfoItem)
+        {
+            aSet.Put (SvxFontListItem(static_cast<const 
SvxFontListItem*>(pInfoItem)->GetFontList(), SID_ATTR_CHAR_FONTLIST ));
+            rTabPage.PageCreated(aSet);
+        }
     }
     else if (rPageId == "background")
     {

Reply via email to