From 233e6a62d12d2d67089f1934777ac41c9fc88238 Mon Sep 17 00:00:00 2001 From: Norbert Thiebaud Date: Fri, 5 Sep 2014 12:44:21 +0200 Subject: fdo#69162 avoid crashing on Accellerator in poorly initialized context Change-Id: If3446ae33f2c2e737acf56bb523519e7b9d9935e Reviewed-on: https://gerrit.libreoffice.org/11293 Reviewed-by: Norbert Thiebaud Tested-by: Norbert Thiebaud --- svtools/source/misc/acceleratorexecute.cxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/svtools/source/misc/acceleratorexecute.cxx b/svtools/source/misc/acceleratorexecute.cxx index 83348b1a779b..4fe6a63d496c 100644 --- a/svtools/source/misc/acceleratorexecute.cxx +++ b/svtools/source/misc/acceleratorexecute.cxx @@ -181,8 +181,11 @@ bool AcceleratorExecute::execute(const css::awt::KeyEvent& aAWTKey) OUString sCommand = impl_ts_findCommand(aAWTKey); // No Command found? Do nothing! User isnt interested on any error handling .-) - if (sCommand.isEmpty()) + // or for some reason m_xContext is NULL (which would crash impl_ts_getURLParser() + if (sCommand.isEmpty() || !m_xContext.is()) + { return false; + } // SAFE -> ---------------------------------- ::osl::ResettableMutexGuard aLock(m_aLock); -- cgit v1.2.3