[orca: 1/2] braille: Fix crash on getShowingLine() without lines



commit 11b59f06dd3478034e9ae2c71c77013e764716e6
Author: Samuel Thibault <samuel thibault ens-lyon org>
Date:   Mon Jun 3 10:50:44 2019 +0200

    braille: Fix crash on getShowingLine() without lines
    
    Scripts might try to call getShowingLine() after a clear() was done.

 src/orca/braille.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/src/orca/braille.py b/src/orca/braille.py
index 93c31161c..966ca77aa 100644
--- a/src/orca/braille.py
+++ b/src/orca/braille.py
@@ -993,7 +993,10 @@ def addLine(line):
 def getShowingLine():
     """Returns the Line that is currently being painted on the display.
     """
-    return _lines[viewport[1]]
+    if len(_lines) > 0:
+        return _lines[viewport[1]]
+    else:
+        return Line()
 
 def setFocus(region, panToFocus=True, getLinkMask=True):
     """Specififes the region with focus.  This region will be positioned


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