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

New commits:
commit 2d7152efbe4420b9ff192d0eccb47b674a8bb666
Author:     Tamás Zolnai <[email protected]>
AuthorDate: Mon Dec 28 14:28:06 2020 +0100
Commit:     Tamás Zolnai <[email protected]>
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 <[email protected]>
    Reviewed-by: Tamás Zolnai <[email protected]>

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())
         {
_______________________________________________
Libreoffice-commits mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to