summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--winaccessibility/source/UAccCOM/MAccessible.cxx4
1 files changed, 4 insertions, 0 deletions
diff --git a/winaccessibility/source/UAccCOM/MAccessible.cxx b/winaccessibility/source/UAccCOM/MAccessible.cxx
index c691f604faac..413999b35fab 100644
--- a/winaccessibility/source/UAccCOM/MAccessible.cxx
+++ b/winaccessibility/source/UAccCOM/MAccessible.cxx
@@ -790,6 +790,10 @@ COM_DECLSPEC_NOTHROW STDMETHODIMP CMAccessible::get_accFocus(VARIANT *pvarChild)
{
IMAccessible* pIMAcc = nullptr;
g_pAgent->GetIAccessibleFromResID(m_dFocusChildID,&pIMAcc);
+ if (pIMAcc == nullptr)
+ {
+ return E_FAIL;
+ }
pIMAcc->AddRef();
pvarChild->vt = VT_DISPATCH;
pvarChild->pdispVal = pIMAcc;