Bug 1250981 - Add null check to mozTabAccessible value r=davidb
authorLorien Hu <lorien@lorienhu.com>
Wed, 24 Feb 2016 11:14:04 -0800
changeset 322186 73966acbf7da86f687a78d8e4a2e801cc144fcba
parent 322185 f73ac870683a9761bdfe5fd62825d38bef900c0f
child 322187 9f784f66988921c600519c79f033809dcdf45bf8
push id5913
push userjlund@mozilla.com
push dateMon, 25 Apr 2016 16:57:49 +0000
treeherdermozilla-beta@dcaf0a6fa115 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdavidb
bugs1250981
milestone47.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1250981 - Add null check to mozTabAccessible value r=davidb
accessible/mac/mozActionElements.mm
--- a/accessible/mac/mozActionElements.mm
+++ b/accessible/mac/mozActionElements.mm
@@ -246,21 +246,23 @@ enum CheckboxValue {
 
 /**
  * Returns the selected tab (the mozAccessible)
  */
 - (id)value
 {
   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;
 }
 
 /**
  * Return the mozAccessibles that are the tabs.
  */