[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - sw/source

Miklos Vajna (via logerrit) logerrit at kemper.freedesktop.org
Thu Jul 15 08:44:42 UTC 2021


 sw/source/core/crsr/crsrsh.cxx |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 6e6cb89df3ee6b001b94a758920b679e5c4d53b8
Author:     Miklos Vajna <vmiklos at collabora.com>
AuthorDate: Wed Jul 14 16:30:49 2021 +0200
Commit:     Tor Lillqvist <tml at collabora.com>
CommitDate: Thu Jul 15 10:44:09 2021 +0200

    sw lok: guard against half-constructed views in sendLOKCursorUpdates()
    
    Crashreport backtrace is:
    
            SwCursorShell::sendLOKCursorUpdates()
                    sw/source/core/crsr/crsrsh.cxx:2044
            SwCursorShell::UpdateCursor(unsigned short, bool)
                    sw/source/core/crsr/crsrsh.cxx:2032
            SwCursorShell::GotoFieldmark(sw::mark::IFieldmark const*)
                    sw/source/core/crsr/crbm.cxx:315
            SwWrtShell::GotoFieldmark(sw::mark::IFieldmark const*)
                    sw/source/uibase/wrtsh/wrtsh3.cxx:93 (discriminator 4)
            SwWrtShell::SwWrtShell(SwDoc&, vcl::Window*, SwView&, SwViewOption const*)
                    sw/source/uibase/wrtsh/wrtsh1.cxx:1709
            SwView::SwView(SfxViewFrame*, SfxViewShell*)
    
    Change-Id: I26e0615747290c1e596db54cdbbc93b61b4067a6
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118938
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Tor Lillqvist <tml at collabora.com>

diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx
index 7a3c3ec421b8..fd0e4aef29a8 100644
--- a/sw/source/core/crsr/crsrsh.cxx
+++ b/sw/source/core/crsr/crsrsh.cxx
@@ -2035,7 +2035,8 @@ void SwCursorShell::UpdateCursor( sal_uInt16 eFlags, bool bIdleEnd )
 void SwCursorShell::sendLOKCursorUpdates()
 {
     SwView* pView = static_cast<SwView*>(GetSfxViewShell());
-    if (!pView)
+    // The view may not have a writer shell if the view's ctor did not finish yet.
+    if (!pView || !pView->GetWrtShellPtr())
         return;
 
     SwWrtShell* pShell = &pView->GetWrtShell();


More information about the Libreoffice-commits mailing list