[orca] Add sanity check for presence of text
- From: Joanmarie Diggs <joanied src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [orca] Add sanity check for presence of text
- Date: Fri, 6 Sep 2019 10:04:17 +0000 (UTC)
commit 156b20d79c3b32b9604e59437ade60dab8b915e2
Author: Joanmarie Diggs <jdiggs igalia com>
Date: Fri Sep 6 12:03:41 2019 +0200
Add sanity check for presence of text
src/orca/scripts/web/script_utilities.py | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
---
diff --git a/src/orca/scripts/web/script_utilities.py b/src/orca/scripts/web/script_utilities.py
index 3c4d4353b..2fd083632 100644
--- a/src/orca/scripts/web/script_utilities.py
+++ b/src/orca/scripts/web/script_utilities.py
@@ -4214,7 +4214,7 @@ class Utilities(script_utilities.Utilities):
debug.println(debug.LEVEL_INFO, msg, True)
return obj, 0
- if offset >= text.characterCount:
+ if text and offset >= text.characterCount:
if self.isLink(obj) and self.isContentEditableWithEmbeddedObjects(obj):
nextObj, nextOffset = self.nextContext(obj, text.characterCount)
if nextObj:
@@ -4227,12 +4227,13 @@ class Utilities(script_utilities.Utilities):
debug.println(debug.LEVEL_INFO, msg, True)
return obj, text.characterCount
- allText = text.getText(0, -1)
offset = max (0, offset)
- if allText[offset] != self.EMBEDDED_OBJECT_CHARACTER or role == pyatspi.ROLE_ENTRY:
- msg = "WEB: First caret context for %s, %i is unchanged" % (obj, offset)
- debug.println(debug.LEVEL_INFO, msg, True)
- return obj, offset
+ if text:
+ allText = text.getText(0, -1)
+ if allText[offset] != self.EMBEDDED_OBJECT_CHARACTER or role == pyatspi.ROLE_ENTRY:
+ msg = "WEB: First caret context for %s, %i is unchanged" % (obj, offset)
+ debug.println(debug.LEVEL_INFO, msg, True)
+ return obj, offset
child = self.getChildAtOffset(obj, offset)
if not child:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]