[orca] Be sure the text interface is implemented before asking for the character count



commit 96b5b305c4647c7af617914bb38a7bec4d9a6717
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Wed Feb 7 15:27:19 2018 -0500

    Be sure the text interface is implemented before asking for the character count

 src/orca/scripts/web/script.py |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/src/orca/scripts/web/script.py b/src/orca/scripts/web/script.py
index 691f05f..ae904d5 100644
--- a/src/orca/scripts/web/script.py
+++ b/src/orca/scripts/web/script.py
@@ -890,7 +890,8 @@ class Script(default.Script):
         obj, offset = self.utilities.getCaretContext(documentFrame=None)
         if offset > 0 and isContentEditable:
             text = self.utilities.queryNonEmptyText(obj)
-            offset = min(offset, text.characterCount)
+            if text:
+                offset = min(offset, text.characterCount)
 
         contents = self.utilities.getLineContentsAtOffset(obj, offset)
         self.displayContents(contents)


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