From 20766586bc44d14488c5cb5db24fc12d3f32f744 Mon Sep 17 00:00:00 2001 From: Lorien Hu Date: Wed, 24 Feb 2016 11:14:04 -0800 Subject: [PATCH] Bug 1250981 - Add null check to mozTabAccessible value r=davidb --- accessible/mac/mozActionElements.mm | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/accessible/mac/mozActionElements.mm b/accessible/mac/mozActionElements.mm index c13da8be58f..5decd6cccc5 100644 --- a/accessible/mac/mozActionElements.mm +++ b/accessible/mac/mozActionElements.mm @@ -251,11 +251,13 @@ enum CheckboxValue { { mozAccessible* nativeAcc = nil; if (AccessibleWrap* accWrap = [self getGeckoAccessible]) { - Accessible* accTab = accWrap->GetSelectedItem(0); - accTab->GetNativeInterface((void**)&nativeAcc); + if (Accessible* accTab = accWrap->GetSelectedItem(0)) { + accTab->GetNativeInterface((void**)&nativeAcc); + } } else if (ProxyAccessible* proxy = [self getProxyAccessible]) { - ProxyAccessible* proxyTab = proxy->GetSelectedItem(0); - nativeAcc = GetNativeFromProxy(proxyTab); + if (ProxyAccessible* proxyTab = proxy->GetSelectedItem(0)) { + nativeAcc = GetNativeFromProxy(proxyTab); + } } return nativeAcc;