summaryrefslogtreecommitdiffstats
path: root/accessibility/source/standard/vclxaccessibletoolbox.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'accessibility/source/standard/vclxaccessibletoolbox.cxx')
-rw-r--r--accessibility/source/standard/vclxaccessibletoolbox.cxx11
1 files changed, 8 insertions, 3 deletions
diff --git a/accessibility/source/standard/vclxaccessibletoolbox.cxx b/accessibility/source/standard/vclxaccessibletoolbox.cxx
index acb1d25471..c9f4546c12 100644
--- a/accessibility/source/standard/vclxaccessibletoolbox.cxx
+++ b/accessibility/source/standard/vclxaccessibletoolbox.cxx
@@ -630,9 +630,14 @@ Reference< XAccessible > SAL_CALL VCLXAccessibleToolBox::getAccessibleChild( sal
if ( pItemWindow )
{
Reference< XAccessible> xParent = xChild;
- rtl::Reference<OToolBoxWindowItem> xChild2( new OToolBoxWindowItem(0,::comphelper::getProcessComponentContext(),pItemWindow->GetAccessible(),xParent) );
- pItemWindow->SetAccessible(xChild2);
- xChild->SetChild( xChild2 );
+ auto const xInnerAcc(pItemWindow->GetAccessible());
+ if (xInnerAcc) // else child is being disposed - avoid crashing
+ {
+ rtl::Reference<OToolBoxWindowItem> xChild2(new OToolBoxWindowItem(0,
+ ::comphelper::getProcessComponentContext(), xInnerAcc, xParent));
+ pItemWindow->SetAccessible(xChild2);
+ xChild->SetChild( xChild2 );
+ }
}
if ( nHighlightItemId > ToolBoxItemId(0) && nItemId == nHighlightItemId )
xChild->SetFocus( true );