[orca] Don't assume we have a valid parent when searching for previous/next object



commit 477f947b3c78ea44d2aacd3139280d232f67ac82
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Tue Sep 13 11:59:36 2016 -0400

    Don't assume we have a valid parent when searching for previous/next object

 src/orca/script_utilities.py |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/orca/script_utilities.py b/src/orca/script_utilities.py
index 899b8b6..cb8f53d 100644
--- a/src/orca/script_utilities.py
+++ b/src/orca/script_utilities.py
@@ -2146,7 +2146,7 @@ class Utilities:
                 return relation.getTarget(0)
 
         index = obj.getIndexInParent() - 1
-        if not (0 <= index < obj.parent.childCount - 1):
+        if not (0 <= index < obj.parent.childCount - 1) and obj.parent:
             obj = obj.parent
             index = obj.getIndexInParent() - 1
 
@@ -2171,7 +2171,7 @@ class Utilities:
                 return relation.getTarget(0)
 
         index = obj.getIndexInParent() + 1
-        if not (0 < index < obj.parent.childCount):
+        if not (0 < index < obj.parent.childCount) and obj.parent:
             obj = obj.parent
             index = obj.getIndexInParent() + 1
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]