svtools/source/misc/acceleratorexecute.cxx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
New commits: commit ccef1a40d420a8220ac07e1cc6387c3d77cebcd5 Author: Noel Grandin <noelgran...@gmail.com> AuthorDate: Mon Sep 30 19:25:32 2024 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Tue Oct 1 11:15:52 2024 +0200 cid#1607958 Data race condition Change-Id: I1d5d0c9eae073f69e4308163dcc62371c31e0d78 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174292 Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> Tested-by: Jenkins diff --git a/svtools/source/misc/acceleratorexecute.cxx b/svtools/source/misc/acceleratorexecute.cxx index 24a4d365e894..b7370436b175 100644 --- a/svtools/source/misc/acceleratorexecute.cxx +++ b/svtools/source/misc/acceleratorexecute.cxx @@ -180,15 +180,16 @@ bool AcceleratorExecute::execute(const css::awt::KeyEvent& aAWTKey) OUString sCommand = impl_ts_findCommand(aAWTKey); // No Command found? Do nothing! User is not interested on any error handling .-) - // or for some reason m_xContext is NULL (which would crash impl_ts_getURLParser() - if (sCommand.isEmpty() || !m_xContext.is()) - { + if (sCommand.isEmpty()) return false; - } // SAFE -> ---------------------------------- std::unique_lock aLock(m_aLock); + // or for some reason m_xContext is NULL (which would crash impl_ts_getURLParser() + if (!m_xContext.is()) + return false; + css::uno::Reference< css::frame::XDispatchProvider > xProvider = m_xDispatcher; aLock.unlock();