Bug 1029695 - [rule view] Need null check for ruleview-propertyvalue query in getParentTextProperty r=harth
authorGabriel Luong <gabriel.luong@gmail.com>
Wed, 25 Jun 2014 16:39:00 +0200
changeset 191167 328c548bb1167fb221cd2fb063ea95d278030d65
parent 191166 8fb18794fe60317d2f79b6726a331baa2da668d9
child 191168 57f870a3e9c11f6d7a26d9f90e58a64eda156fba
push id8436
push usercbook@mozilla.com
push dateFri, 27 Jun 2014 13:56:57 +0000
treeherderb2g-inbound@22ea396750e8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersharth
bugs1029695
milestone33.0a1
Bug 1029695 - [rule view] Need null check for ruleview-propertyvalue query in getParentTextProperty r=harth
browser/devtools/styleinspector/rule-view.js
--- a/browser/devtools/styleinspector/rule-view.js
+++ b/browser/devtools/styleinspector/rule-view.js
@@ -2864,17 +2864,23 @@ function getParentTextPropertyHolder(nod
  * @param {DOMNode} node The node to start from
  * @return {TextProperty}
  */
 function getParentTextProperty(node) {
   let parent = getParentTextPropertyHolder(node);
   if (!parent) {
     return null;
   }
-  return parent.querySelector(".ruleview-propertyvalue").textProperty;
+
+  let propValue = parent.querySelector(".ruleview-propertyvalue");
+  if (!propValue) {
+    return null;
+  }
+
+  return propValue.textProperty;
 }
 
 /**
  * Walker up the DOM from a given node until a parent property holder is found,
  * and return the textContent for the name and value nodes.
  * Stops at the first property found, so if node is inside the computed property
  * list, the computed property will be returned
  * @param {DOMNode} node The node to start from