sc/source/core/data/SheetViewManager.cxx |    5 +++++
 1 file changed, 5 insertions(+)

New commits:
commit 437d332908ac002075a2650fb91bf70460ef4049
Author:     Miklos Vajna <[email protected]>
AuthorDate: Tue Feb 3 14:54:55 2026 +0100
Commit:     Miklos Vajna <[email protected]>
CommitDate: Wed Feb 4 12:59:25 2026 +0100

    sc: fix crash in SheetViewManager::unsyncAllSheetViews()
    
    gdb on the crashreport's core file:
    
            #0  0x00007afad505b307 in sc::SheetView::unsync (this=0x0) at 
sc/inc/SheetView.hxx:44
            #1  sc::SheetViewManager::unsyncAllSheetViews (this=0x11fa76c0) at 
sc/source/core/data/SheetViewManager.cxx:120
            #2  0x00007afad552a415 in sc::SheetViewOperationsTester::check 
(this=this@entry=0x7ffcad3703c0, eOperation=<optimized out>, 
eOperation@entry=sc::Operation::DeleteRows)
                at sc/source/ui/docshell/SheetViewOperationsTester.cxx:157
            #3  0x00007afad54c2235 in ScDocFunc::CheckSheetViewProtection 
(eOperation=sc::Operation::DeleteRows)
                at sc/source/ui/docshell/docfunc.cxx:126
            #4  ScDocFunc::DeleteCells (this=0x124ca680, rRange=..., 
pTabMark=pTabMark@entry=0x164cec90, eCmd=<optimized out>, 
eCmd@entry=DelCellCmd::Rows, bApi=bApi@entry=false)
                at sc/source/ui/docshell/docfunc.cxx:2469
            #5  0x00007afad5971e06 in ScViewFunc::DeleteCells 
(this=this@entry=0x164cec60, eCmd=eCmd@entry=DelCellCmd::Rows) at 
/opt/rh/devtoolset-12/root/usr/include/c++/12/bits/unique_ptr.h:445
            #6  0x00007afad57f13c6 in ScCellShell::ExecuteEdit 
(this=0x183359d0, rReq=...)
                at sc/source/ui/view/cellsh1.cxx:348
    
    Seeing that SheetViewManager::getPreviousSheetView() checks if the
    pointers in the maViews container are nullptr, do the same here.
    
    Change-Id: I0e430edacccae83e2d2d5e7228c437dbd1de5d60
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198645
    Tested-by: Jenkins
    Reviewed-by: Miklos Vajna <[email protected]>

diff --git a/sc/source/core/data/SheetViewManager.cxx 
b/sc/source/core/data/SheetViewManager.cxx
index a0ef1164293d..bbc5d63dd7ac 100644
--- a/sc/source/core/data/SheetViewManager.cxx
+++ b/sc/source/core/data/SheetViewManager.cxx
@@ -117,6 +117,11 @@ void SheetViewManager::unsyncAllSheetViews()
 {
     for (auto const& pSheetView : maViews)
     {
+        if (!pSheetView)
+        {
+            continue;
+        }
+
         pSheetView->unsync();
     }
 }

Reply via email to