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



commit cfffe5e159d04d1ee674f42784820b40e33a7175
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Tue Sep 13 12:08:32 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 97e180b..61d6185 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 obj.parent and not (0 <= index < obj.parent.childCount - 1):
             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 obj.parent and not (0 < index < obj.parent.childCount):
             obj = obj.parent
             index = obj.getIndexInParent() + 1
 


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