| Index: chrome/browser/resources/chromeos/chromevox/cvox2/background/cursors.js
|
| diff --git a/chrome/browser/resources/chromeos/chromevox/cvox2/background/cursors.js b/chrome/browser/resources/chromeos/chromevox/cvox2/background/cursors.js
|
| index 82dec9cf54646f73909d11158ed5ceca74dd3fbd..af31d1710163a1a298ccdb96be15fd8a6ef05481 100644
|
| --- a/chrome/browser/resources/chromeos/chromevox/cvox2/background/cursors.js
|
| +++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/cursors.js
|
| @@ -314,7 +314,7 @@ cursors.Cursor.prototype = {
|
| * @return {boolean}
|
| */
|
| isValid: function() {
|
| - return !!this.node && !!this.node.root;
|
| + return this.node != null;
|
| }
|
| };
|
|
|
| @@ -555,10 +555,13 @@ cursors.Range.prototype = {
|
| // Find the most common root.
|
| var uniqueAncestors = AutomationUtil.getUniqueAncestors(start, end);
|
| var mcr = start.root;
|
| - if (uniqueAncestors)
|
| - mcr = uniqueAncestors.pop().parent.root;
|
| + if (uniqueAncestors) {
|
| + var common = uniqueAncestors.pop().parent;
|
| + if (common)
|
| + mcr = common.root;
|
| + }
|
|
|
| - if (mcr.role == RoleType.desktop)
|
| + if (!mcr || mcr.role == RoleType.desktop)
|
| return;
|
|
|
| if (mcr === start.root && mcr === end.root) {
|
|
|