[orca] Handle exception getting childcount



commit c9004a71b6a5d605fb798e4cdce5c84f66947533
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Tue Oct 16 13:57:31 2018 +0200

    Handle exception getting childcount

 src/orca/script_utilities.py | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
---
diff --git a/src/orca/script_utilities.py b/src/orca/script_utilities.py
index d5f630c41..8ca544e79 100644
--- a/src/orca/script_utilities.py
+++ b/src/orca/script_utilities.py
@@ -3639,7 +3639,14 @@ class Utilities:
         return child
 
     def popupMenuFor(self, obj):
-        if not obj and obj.childCount:
+        if not obj:
+            return None
+
+        try:
+            childCount = obj.childCount
+        except:
+            msg = "ERROR: Exception getting childCount for %s" % obj
+            debug.println(debug.LEVEL_INFO, msg, True)
             return None
 
         menus = [child for child in obj if child.getRole() == pyatspi.ROLE_MENU]


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