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-06-17 06:48:29 +0000
commit1bc3c88bc9ed085bf7e173cb12f313934d92f309 (patch)
tree06f293f5f40d7055fc4b5a3567826a0ab8fcd2ee /sw
parenta1f836e40d30fa39478e31ed8bc7bd947d4803c9 (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>
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 c6b6da2109ae..44db22d8aaad 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 )