sw/source/uibase/uno/unotxdoc.cxx | 5 +++++ 1 file changed, 5 insertions(+)
New commits: commit 42865108702f80a829513aef8f45965c508d0a74 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 16:31:55 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/+/124060 Reviewed-by: Miklos Vajna <vmik...@collabora.com> Tested-by: Jenkins diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx index 6fa6e6a6bd85..a3eeca0341f9 100644 --- a/sw/source/uibase/uno/unotxdoc.cxx +++ b/sw/source/uibase/uno/unotxdoc.cxx @@ -3483,6 +3483,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);