diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2016-03-28 19:03:20 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2016-06-18 17:01:45 +0200 |
commit | c2b5de7e5ed9d03a2e9a38345a2460c74c351047 (patch) | |
tree | 5b51bd8054582e3afd75a3965d8f3c610e705197 /vcl | |
parent | 4d1004f0dcc3df135128fe5411c5dd0635e8ee7e (diff) |
uitest: avoid crashes when trying to access missing UI object
Change-Id: Icf6acf23be021bcf386c574289966eff813a67e3
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/uitest/uno/uiobject_uno.cxx | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/vcl/source/uitest/uno/uiobject_uno.cxx b/vcl/source/uitest/uno/uiobject_uno.cxx index 8f3a3c5c7224..a80e6465f50b 100644 --- a/vcl/source/uitest/uno/uiobject_uno.cxx +++ b/vcl/source/uitest/uno/uiobject_uno.cxx @@ -23,6 +23,9 @@ UIObjectUnoObj::~UIObjectUnoObj() css::uno::Reference<css::ui::test::XUIObject> SAL_CALL UIObjectUnoObj::getChild(const OUString& rID) throw (css::uno::RuntimeException, std::exception) { + if (!mpObj) + throw css::uno::RuntimeException(); + SolarMutexGuard aGuard; std::unique_ptr<UIObject> pObj = mpObj->get_child(rID); return new UIObjectUnoObj(std::move(pObj)); @@ -31,6 +34,9 @@ css::uno::Reference<css::ui::test::XUIObject> SAL_CALL UIObjectUnoObj::getChild( void SAL_CALL UIObjectUnoObj::executeAction(const OUString& rAction, const css::uno::Sequence<css::beans::PropertyValue>& rPropValues) throw (css::uno::RuntimeException, std::exception) { + if (!mpObj) + throw css::uno::RuntimeException(); + SolarMutexGuard aGuard; StringMap aMap; for (sal_Int32 i = 0, n = rPropValues.getLength(); i < n; ++i) @@ -47,6 +53,9 @@ void SAL_CALL UIObjectUnoObj::executeAction(const OUString& rAction, const css:: css::uno::Sequence<css::beans::PropertyValue> UIObjectUnoObj::getState() throw (css::uno::RuntimeException, std::exception) { + if (!mpObj) + throw css::uno::RuntimeException(); + SolarMutexGuard aGuard; StringMap aMap = mpObj->get_state(); css::uno::Sequence<css::beans::PropertyValue> aProps(aMap.size()); |