[orca] Don't use invalid indices on empty selection



commit e3b2b86a57911614033bba8a1034233256c116d3
Author: Michael Weghorn <m weghorn posteo de>
Date:   Tue Sep 6 08:20:45 2022 +0200

    Don't use invalid indices on empty selection

 src/orca/script_utilities.py | 4 ++++
 1 file changed, 4 insertions(+)
---
diff --git a/src/orca/script_utilities.py b/src/orca/script_utilities.py
index 248270ed7..21e87c8f1 100644
--- a/src/orca/script_utilities.py
+++ b/src/orca/script_utilities.py
@@ -4174,6 +4174,10 @@ class Utilities:
             debug.println(debug.LEVEL_INFO, msg, True)
             return None, None
 
+        msg = "INFO: %s reports %i selected children" % (obj, count)
+        debug.println(debug.LEVEL_INFO, msg, True)
+        if count < 1:
+            return None, None
         return selection.getSelectedChild(0), selection.getSelectedChild(count-1)
 
     def focusedChild(self, obj):


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