Bug 1180189 - Fix crash in mozilla::a11y::HTMLTableRowAccessible::GroupPosition. r=MarcoZ, a=ritu
authorFrédéric Wang <fred.wang@free.fr>
Tue, 14 Jul 2015 09:27:26 +0200
changeset 270327 4fcca0b037e16753ad0c751232a43d5794c0a514
parent 270326 3580300f51dc4e24a693390fe1896015110e6316
child 270328 adf1daf281fd1c9496d41b67707c2d323c65b566
push id8216
push userryanvm@gmail.com
push dateThu, 16 Jul 2015 22:24:19 +0000
treeherdermozilla-aurora@adf1daf281fd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersMarcoZ, ritu
bugs1180189
milestone41.0a2
Bug 1180189 - Fix crash in mozilla::a11y::HTMLTableRowAccessible::GroupPosition. r=MarcoZ, a=ritu
accessible/html/HTMLTableAccessible.cpp
--- a/accessible/html/HTMLTableAccessible.cpp
+++ b/accessible/html/HTMLTableAccessible.cpp
@@ -368,18 +368,19 @@ HTMLTableRowAccessible::NativeRole()
   }
   return roles::ROW;
 }
 
 GroupPos
 HTMLTableRowAccessible::GroupPosition()
 {
   int32_t count = 0, index = 0;
-  if (nsCoreUtils::GetUIntAttr(nsAccUtils::TableFor(this)->GetContent(),
-                               nsGkAtoms::aria_rowcount, &count) &&
+  Accessible* table = nsAccUtils::TableFor(this);
+  if (table && nsCoreUtils::GetUIntAttr(table->GetContent(),
+                                        nsGkAtoms::aria_rowcount, &count) &&
       nsCoreUtils::GetUIntAttr(mContent, nsGkAtoms::aria_rowindex, &index)) {
     return GroupPos(0, index, count);
   }
 
   return AccessibleWrap::GroupPosition();
 }
 
 ////////////////////////////////////////////////////////////////////////////////