sc/source/ui/view/formatsh.cxx |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit cb3ae5bb64f30552da1d5ff2bd9e58f8ede85f8b
Author:     Caolán McNamara <caolan.mcnam...@collabora.com>
AuthorDate: Tue Oct 10 16:29:16 2023 +0100
Commit:     Michael Stahl <michael.st...@allotropia.de>
CommitDate: Wed Oct 11 10:48:48 2023 +0200

    tdf#154142 null-deref in SfxUndoManager::SetMaxUndoActionCount
    
    Change-Id: I09cfbccb5f2ffa009a3e40157c9373b7e10864dc
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157772
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.st...@allotropia.de>

diff --git a/sc/source/ui/view/formatsh.cxx b/sc/source/ui/view/formatsh.cxx
index c1b36c2fbd53..cb52e99c5b4c 100644
--- a/sc/source/ui/view/formatsh.cxx
+++ b/sc/source/ui/view/formatsh.cxx
@@ -134,7 +134,7 @@ ScFormatShell::ScFormatShell(ScViewData& rData) :
     SetPool( &pTabViewShell->GetPool() );
     SfxUndoManager* pMgr = rViewData.GetSfxDocShell()->GetUndoManager();
     SetUndoManager( pMgr );
-    if ( !rViewData.GetDocument().IsUndoEnabled() )
+    if (pMgr && !rViewData.GetDocument().IsUndoEnabled())
     {
         pMgr->SetMaxUndoActionCount( 0 );
     }

Reply via email to