sw/source/uibase/uno/unotxdoc.cxx | 5 +++++ 1 file changed, 5 insertions(+)
New commits: commit 7f35374f1da04b1d6416396dcf63ddb0c7872fd0 Author: Miklos Vajna <vmik...@collabora.com> AuthorDate: Thu Oct 21 08:25:55 2021 +0200 Commit: Miklos Vajna <vmik...@collabora.com> CommitDate: Fri Oct 22 09:23:18 2021 +0200 sw: fix crash in SwXTextDocument::postMouseEvent() From crashreport: SIG Fatal signal received: SIGSEGV SwXTextDocument::postMouseEvent(int, int, int, int, int, int) sw/source/uibase/uno/unotxdoc.cxx:3559 doc_postMouseEvent desktop/source/lib/init.cxx:4245 Make sure we don't crash when a mouse event is posted on a disposed document. Change-Id: I3fb123460b21bf8fe21406d1745f43270102af33 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123947 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124044 Reviewed-by: Miklos Vajna <vmik...@collabora.com> diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx index eba39194a7e0..4e459bfa2e45 100644 --- a/sw/source/uibase/uno/unotxdoc.cxx +++ b/sw/source/uibase/uno/unotxdoc.cxx @@ -3547,6 +3547,11 @@ void SwXTextDocument::postMouseEvent(int nType, int nX, int nY, int nCount, int SolarMutexGuard aGuard; SwViewShell* pWrtViewShell = m_pDocShell->GetWrtShell(); + if (!pWrtViewShell) + { + return; + } + SwViewOption aOption(*(pWrtViewShell->GetViewOptions())); double fScale = aOption.GetZoom() / (TWIPS_PER_PIXEL * 100.0);