sd/source/ui/unoidl/unomodel.cxx |    5 +++++
 1 file changed, 5 insertions(+)

New commits:
commit c64bc117e4db04c382b68f14acb47c6b967e2074
Author:     Miklos Vajna <[email protected]>
AuthorDate: Fri Nov 21 09:28:13 2025 +0100
Commit:     Miklos Vajna <[email protected]>
CommitDate: Mon Nov 24 10:26:48 2025 +0100

    sd: fix crash in SdXImpressDocument::postMouseEvent()
    
    gdb trace on the core file:
    
            #0  0x0000774df1e04d9d in SdrPageView::GetPage (this=0x0) at 
/home/collabora/jenkins/workspace/build_core_co-25.04_for_online_snapshot/include/svx/svdpagv.hxx:167
            #1  SdXImpressDocument::postMouseEvent (this=<optimized out>, 
nType=2, nX=<optimized out>, nY=<optimized out>, nCount=1, nButtons=0, 
nModifier=0)
                at 
/home/collabora/jenkins/workspace/build_core_co-25.04_for_online_snapshot/sd/source/ui/unoidl/unomodel.cxx:4370
            #2  0x0000774e00fbec12 in doc_postMouseEvent (pThis=0x3cd69250, 
nType=2, nX=-180, nY=2220, nCount=1, nButtons=0, nModifier=0)
                at 
/home/collabora/jenkins/workspace/build_core_co-25.04_for_online_snapshot/desktop/source/lib/init.cxx:5661
            #3  0x000000000058ab29 in lok::Document::postMouseEvent 
(nModifier=0, nButtons=0, nCount=<optimized out>, nY=<optimized out>, 
nX=<optimized out>, nType=<optimized out>,
                this=<optimized out>) at 
/home/collabora/jenkins/workspace/package_cool_25.04_rpm/rpmbuild/BUILD/coolwsd-25.04.7.2snapshot/bundled/include/LibreOfficeKit/LibreOfficeKit.hxx:297
    
    Handle it similar to the nullptr sd Window just a bit later.
    
    Change-Id: I7a6e7dfc6971f266e1205ee3b92eb1ed5bae1025
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194303
    Reviewed-by: Caolán McNamara <[email protected]>
    Tested-by: Jenkins CollaboraOffice <[email protected]>
    (cherry picked from commit 775840f89091853b4424a4b94d7081058d076f16)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/194420
    Tested-by: Miklos Vajna <[email protected]>
    Reviewed-by: Tomaž Vajngerl <[email protected]>

diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx
index efb3a0bd52a6..736658e9c4b5 100644
--- a/sd/source/ui/unoidl/unomodel.cxx
+++ b/sd/source/ui/unoidl/unomodel.cxx
@@ -4367,6 +4367,11 @@ void SdXImpressDocument::postMouseEvent(int nType, int 
nX, int nY, int nCount, i
     const Point aPointHMM = o3tl::convert(aPointTwip, o3tl::Length::twip, 
o3tl::Length::mm100);
     SdrView* pDrawView = pViewShell->GetDrawView();
     SdrPageView* pPageView = pDrawView->GetSdrPageView();
+    if (!pPageView)
+    {
+        return;
+    }
+
     SdrPage* pPage = pPageView->GetPage();
     ::sd::Window* pActiveWin = pViewShell->GetActiveWindow();
     if (!pActiveWin)

Reply via email to