[orca] Fail gracefully when an exception is encountered getting role of parent



commit 11ea6df7da7da039e8f821bdcb500d33918ee346
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Tue Oct 16 11:46:05 2018 +0200

    Fail gracefully when an exception is encountered getting role of parent

 src/orca/scripts/web/script_utilities.py | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
---
diff --git a/src/orca/scripts/web/script_utilities.py b/src/orca/scripts/web/script_utilities.py
index d56dc7f49..b6edcc90d 100644
--- a/src/orca/scripts/web/script_utilities.py
+++ b/src/orca/scripts/web/script_utilities.py
@@ -727,7 +727,13 @@ class Utilities(script_utilities.Utilities):
             return [0, 0, 0, 0]
 
         role = obj.getRole()
-        parentRole = obj.parent.getRole()
+        try:
+            parentRole = obj.parent.getRole()
+        except:
+            msg = "WEB: Exception getting role of parent (%s) of %s" % (obj.parent, obj)
+            debug.println(debug.LEVEL_INFO, msg, True)
+            parentRole = None
+
         if role in [pyatspi.ROLE_MENU, pyatspi.ROLE_LIST_ITEM] \
            and parentRole in [pyatspi.ROLE_COMBO_BOX, pyatspi.ROLE_LIST_BOX]:
             try:


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