[orca] Be sure we have an object when frameAndDialog is called



commit ebbbd3d9902fecd6bd66c82a5cff0e93f1014955
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Mon Apr 13 15:14:44 2020 -0400

    Be sure we have an object when frameAndDialog is called

 src/orca/script_utilities.py | 6 ++++++
 1 file changed, 6 insertions(+)
---
diff --git a/src/orca/script_utilities.py b/src/orca/script_utilities.py
index 3243abe96..750cf3a43 100644
--- a/src/orca/script_utilities.py
+++ b/src/orca/script_utilities.py
@@ -635,6 +635,12 @@ class Utilities:
 
         results = [None, None]
 
+        obj = obj or orca_state.locusOfFocus
+        if not obj:
+            msg = "ERROR: frameAndDialog() called without valid object"
+            debug.println(debug.LEVEL_INFO, msg, True)
+            return results
+
         if obj.getRole() == pyatspi.ROLE_FRAME:
             results[0] = obj
 


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