summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2016-06-16 16:50:11 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2016-07-08 11:31:29 +0200
commit1d2bcfa46a2e41e93ca47cacb54173b635df2cac (patch)
tree59eb0deab3421e81dc1f9148e25073ce976f8b16 /sw
parentcc9e6a245277401d2f7e32b7d440b1fc049287da (diff)
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 Change-Id: I8cfcad465803e37ec9d01d035428c5ca953adf14 Reviewed-on: https://gerrit.libreoffice.org/26380 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org> (cherry picked from commit 1bc3c88bc9ed085bf7e173cb12f313934d92f309)
Diffstat (limited to 'sw')
-rw-r--r--sw/source/uibase/dochdl/swdtflvr.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/sw/source/uibase/dochdl/swdtflvr.cxx b/sw/source/uibase/dochdl/swdtflvr.cxx
index 083a0d5cbf7a..846ff8543e12 100644
--- a/sw/source/uibase/dochdl/swdtflvr.cxx
+++ b/sw/source/uibase/dochdl/swdtflvr.cxx
@@ -3306,7 +3306,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 )