diff options
author | Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> | 2018-01-10 13:25:33 +0100 |
---|---|---|
committer | Thorsten Behrens <Thorsten.Behrens@CIB.de> | 2018-01-11 10:15:41 +0100 |
commit | 9cbd76c050de4b770c4c30582c957d4d44b8c457 (patch) | |
tree | c982b57a8d70a332b892e997b00dc9742489af02 | |
parent | c2683a7365fb0779245db07df7f7b91de6fcbb05 (diff) |
tdf#113874 Guard against invalid states
Change-Id: I013dd4eb81f0fbef25d9f58e27fe72d800d910ba
Reviewed-on: https://gerrit.libreoffice.org/47702
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
(cherry picked from commit d2763bde00f0f840585e1ec4c8f94c0ef804a580)
Reviewed-on: https://gerrit.libreoffice.org/47711
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
-rw-r--r-- | vcl/source/window/accessibility.cxx | 4 | ||||
-rw-r--r-- | vcl/source/window/window.cxx | 3 |
2 files changed, 5 insertions, 2 deletions
diff --git a/vcl/source/window/accessibility.cxx b/vcl/source/window/accessibility.cxx index 01eaf5fd7709..38344b9a7802 100644 --- a/vcl/source/window/accessibility.cxx +++ b/vcl/source/window/accessibility.cxx @@ -141,7 +141,9 @@ css::uno::Reference< css::accessibility::XAccessible > Window::CreateAccessible( void Window::SetAccessible( const css::uno::Reference< css::accessibility::XAccessible >& x ) { - assert(mpWindowImpl); + if (!mpWindowImpl) + return; + mpWindowImpl->mxAccessible = x; } diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index eb5e72e6d30b..1bac5a65a30c 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -3152,7 +3152,8 @@ const OUString& Window::GetHelpText() const void Window::SetWindowPeer( Reference< css::awt::XWindowPeer > const & xPeer, VCLXWindow* pVCLXWindow ) { - assert(mpWindowImpl); + if (!mpWindowImpl) + return; // be safe against re-entrance: first clear the old ref, then assign the new one mpWindowImpl->mxWindowPeer.clear(); |