Bug 1429940 - Null-check the GetContent call on the parent. r=Jamie
authorPaolo Amadini <paolo.mozmail@amadzone.org>
Wed, 21 Nov 2018 15:24:13 +0000
changeset 504026 f13bbf0e59ae40749a4600e4f936f611b7135c93
parent 504025 1d4a0822756a5babd2e128ac1a968e67df001b46
child 504027 6ed01bcdf9e422477e660e7bed1923742baf0422
push id10290
push userffxbld-merge
push dateMon, 03 Dec 2018 16:23:23 +0000
treeherdermozilla-beta@700bed2445e6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersJamie
bugs1429940
milestone65.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 1429940 - Null-check the GetContent call on the parent. r=Jamie
accessible/xul/XULElementAccessibles.cpp
--- a/accessible/xul/XULElementAccessibles.cpp
+++ b/accessible/xul/XULElementAccessibles.cpp
@@ -89,19 +89,21 @@ Relation
 XULLabelAccessible::RelationByType(RelationType aType) const
 {
   Relation rel = HyperTextAccessibleWrap::RelationByType(aType);
 
   // The label for xul:groupbox is generated from the first xul:label
   if (aType == RelationType::LABEL_FOR) {
     Accessible* parent = Parent();
     if (parent && parent->Role() == roles::GROUPING &&
-        parent->GetContent()->IsXULElement(nsGkAtoms::groupbox) &&
         parent->GetChildAt(0) == this) {
-      rel.AppendTarget(parent);
+      nsIContent* parentContent = parent->GetContent();
+      if (parentContent && parentContent->IsXULElement(nsGkAtoms::groupbox)) {
+        rel.AppendTarget(parent);
+      }
     }
   }
 
   return rel;
 }
 
 void
 XULLabelAccessible::UpdateLabelValue(const nsString& aValue)