Index: chrome/browser/resources/chromeos/chromevox/cvox2/background/tree_walker.js |
diff --git a/chrome/browser/resources/chromeos/chromevox/cvox2/background/tree_walker.js b/chrome/browser/resources/chromeos/chromevox/cvox2/background/tree_walker.js |
index f947a066c4d1a248288fda4c48dcef89f11e5023..268ce13edb8180be10d43907391dd8c2d030836a 100644 |
--- a/chrome/browser/resources/chromeos/chromevox/cvox2/background/tree_walker.js |
+++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/tree_walker.js |
@@ -88,7 +88,7 @@ AutomationTreeWalker = function(node, dir, opt_restrictions) { |
* backward. |
* @type {chrome.automation.AutomationNode} @private |
*/ |
- this.backwardAncestor_ = node.parent; |
+ this.backwardAncestor_ = node.parent || null; |
var restrictions = opt_restrictions || {}; |
this.visitPred_ = function(node) { |
@@ -221,8 +221,8 @@ AutomationTreeWalker.prototype = { |
} |
if (node.parent && this.backwardAncestor_ == node.parent) { |
this.phase_ = AutomationTreeWalkerPhase.ANCESTOR; |
- this.backwardAncestor_ = node.parent.parent; |
+ this.backwardAncestor_ = node.parent.parent || null; |
} |
- this.node_ = node.parent; |
+ this.node_ = node.parent || null; |
} |
}; |