summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNorbert Thiebaud <nthiebaud@gmail.com>2014-09-05 12:44:21 +0200
committerNorbert Thiebaud <nthiebaud@gmail.com>2014-09-05 05:48:11 -0500
commit233e6a62d12d2d67089f1934777ac41c9fc88238 (patch)
treef9e77ab7a73f96bcf36792aef48186e40450354d
parent9448bf9182ffd4280cc17d9e5572934871a5c035 (diff)
fdo#69162 avoid crashing on Accellerator in poorly initialized context
Change-Id: If3446ae33f2c2e737acf56bb523519e7b9d9935e Reviewed-on: https://gerrit.libreoffice.org/11293 Reviewed-by: Norbert Thiebaud <nthiebaud@gmail.com> Tested-by: Norbert Thiebaud <nthiebaud@gmail.com>
-rw-r--r--svtools/source/misc/acceleratorexecute.cxx5
1 files changed, 4 insertions, 1 deletions
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);