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

Tamás Zolnai (via logerrit) logerrit at kemper.freedesktop.org
Mon Dec 28 14:49:37 UTC 2020


 sw/source/uibase/uno/unotxdoc.cxx |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 2d7152efbe4420b9ff192d0eccb47b674a8bb666
Author:     Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Mon Dec 28 14:28:06 2020 +0100
Commit:     Tamás Zolnai <tamas.zolnai at collabora.com>
CommitDate: Mon Dec 28 15:49:02 2020 +0100

    Fix crash in SwXTextDocument::getSelection() method.
    
    pWrtShell was nullptr. This crash was triggered by
    an collaborative editing use case.
    
    Change-Id: Id64298b424f5ac4d96df97581c6fe3067e799eb3
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108410
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Tamás Zolnai <tamas.zolnai at collabora.com>

diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx
index 156f0b0d629c..9a0ebcafcc1e 100644
--- a/sw/source/uibase/uno/unotxdoc.cxx
+++ b/sw/source/uibase/uno/unotxdoc.cxx
@@ -3602,7 +3602,7 @@ uno::Reference<datatransfer::XTransferable> SwXTextDocument::getSelection()
     uno::Reference<datatransfer::XTransferable> xTransferable;
 
     SwWrtShell* pWrtShell = pDocShell->GetWrtShell();
-    if (SdrView* pSdrView = pWrtShell->GetDrawView())
+    if (SdrView* pSdrView = pWrtShell ? pWrtShell->GetDrawView() : nullptr)
     {
         if (pSdrView->GetTextEditObject())
         {


More information about the Libreoffice-commits mailing list