sw/source/uibase/uno/unotxdoc.cxx | 5 +++++ 1 file changed, 5 insertions(+)
New commits: commit 66b0a84eae89c7fe02a4cdc4d314f4203025774e Author: Miklos Vajna <vmik...@collabora.com> AuthorDate: Thu Oct 21 08:25:55 2021 +0200 Commit: Mike Kaganski <mike.kagan...@collabora.com> CommitDate: Thu Oct 21 15:28:48 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> diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx index 0a5fec9a18d5..bec5f57762eb 100644 --- a/sw/source/uibase/uno/unotxdoc.cxx +++ b/sw/source/uibase/uno/unotxdoc.cxx @@ -3556,6 +3556,11 @@ void SwXTextDocument::postMouseEvent(int nType, int nX, int nY, int nCount, int SolarMutexGuard aGuard; SwViewShell* pWrtViewShell = pDocShell->GetWrtShell(); + if (!pWrtViewShell) + { + return; + } + SwViewOption aOption(*(pWrtViewShell->GetViewOptions())); double fScale = aOption.GetZoom() / (TWIPS_PER_PIXEL * 100.0);