sw/source/uibase/dochdl/swdtflvr.cxx |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 91f2f71e7b936c3c9fb984aaa01d432926abb38f
Author: Miklos Vajna <vmik...@collabora.co.uk>
Date:   Thu Jun 16 16:50:11 2016 +0200

    sw: fix crash on pasting from an already closed document
    
    As pointed out by
    
<http://crashreport.libreoffice.org/stats/signature/%60anonymous%20namespace'::lcl_checkClassification%28SwDoc%20*,SwDoc%20*%29+0x0>.
    Thanks to Michael Stahl for figuring out the list of steps to reproduce
    this bug:
    
    1) Create a new Writer document
    2) Type some text
    3) Select all
    4) Copy it
    5) Close the document
    6) Create a second Writer document
    7) Paste -> crash
    
    (cherry picked from commit 1bc3c88bc9ed085bf7e173cb12f313934d92f309)
    
    Change-Id: I8cfcad465803e37ec9d01d035428c5ca953adf14
    Reviewed-on: https://gerrit.libreoffice.org/26613
    Tested-by: Jenkins <c...@libreoffice.org>
    Reviewed-by: Markus Mohrhard <markus.mohrh...@googlemail.com>

diff --git a/sw/source/uibase/dochdl/swdtflvr.cxx 
b/sw/source/uibase/dochdl/swdtflvr.cxx
index ab8d5f4..e496d29 100644
--- a/sw/source/uibase/dochdl/swdtflvr.cxx
+++ b/sw/source/uibase/dochdl/swdtflvr.cxx
@@ -3286,7 +3286,8 @@ bool SwTransferable::PrivatePaste( SwWrtShell& rShell )
     }
 
     bool bRet = true;
-    if (lcl_checkClassification(m_pWrtShell->GetDoc(), rShell.GetDoc()))
+    // m_pWrtShell is nullptr when the source document is closed already.
+    if (!m_pWrtShell || lcl_checkClassification(m_pWrtShell->GetDoc(), 
rShell.GetDoc()))
         bRet = rShell.Paste(m_pClpDocFac->GetDoc());
 
     if( bKillPaMs )
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to