diff options
author | Katarina Behrens <Katarina.Behrens@cib.de> | 2018-10-23 12:08:41 +0200 |
---|---|---|
committer | Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> | 2018-10-23 14:26:45 +0200 |
commit | 509c017f5a6ee6b7c1bb9b61b36aef58a06afd27 (patch) | |
tree | 19064bee8006fab394c63f9565d07f4108357d35 /vcl/qt5/Qt5AccessibleWidget.cxx | |
parent | 87e7b4bf4b81b82f43abb7dcafcc733ebca5fb42 (diff) |
tdf#120803: avoid crash if no valid vcl::Window
when called from the destructor it is no longer alive
Change-Id: Ia68272253f9c459b2647a0bd389e833fb0b519e3
Reviewed-on: https://gerrit.libreoffice.org/62228
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Diffstat (limited to 'vcl/qt5/Qt5AccessibleWidget.cxx')
-rw-r--r-- | vcl/qt5/Qt5AccessibleWidget.cxx | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/vcl/qt5/Qt5AccessibleWidget.cxx b/vcl/qt5/Qt5AccessibleWidget.cxx index dbfa9ed57897..6b6832745b07 100644 --- a/vcl/qt5/Qt5AccessibleWidget.cxx +++ b/vcl/qt5/Qt5AccessibleWidget.cxx @@ -642,7 +642,10 @@ QAccessibleInterface* Qt5AccessibleWidget::customFactory(const QString& classnam if (classname == QLatin1String("Qt5Widget") && object && object->isWidgetType()) { Qt5Widget* pWidget = static_cast<Qt5Widget*>(object); - return new Qt5AccessibleWidget(pWidget->m_pFrame->GetWindow()->GetAccessible()); + vcl::Window* pWindow = pWidget->m_pFrame->GetWindow(); + + if (pWindow) + return new Qt5AccessibleWidget(pWindow->GetAccessible()); } if (classname == QLatin1String("Qt5XAccessible") && object) { |