[orca] Add sanity checks to thwart the impact of dead accessibles in WebKitGtk
- From: Joanmarie Diggs <joanied src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [orca] Add sanity checks to thwart the impact of dead accessibles in WebKitGtk
- Date: Wed, 14 Dec 2011 17:44:24 +0000 (UTC)
commit 259bc2c51f5cc9b17c7d9e9c02a12377a8e40718
Author: Joanmarie Diggs <jdiggs igalia com>
Date: Wed Dec 14 12:43:14 2011 -0500
Add sanity checks to thwart the impact of dead accessibles in WebKitGtk
src/orca/script_utilities.py | 6 +++++-
src/orca/structural_navigation.py | 7 ++++++-
2 files changed, 11 insertions(+), 2 deletions(-)
---
diff --git a/src/orca/script_utilities.py b/src/orca/script_utilities.py
index 4cc2c7e..e141291 100644
--- a/src/orca/script_utilities.py
+++ b/src/orca/script_utilities.py
@@ -2824,7 +2824,11 @@ class Utilities:
#
# The keybindings in <full-path> should be separated by ":"
#
- bindingStrings = action.getKeyBinding(0).decode("UTF-8").split(';')
+ try:
+ bindingStrings = action.getKeyBinding(0).decode("UTF-8").split(';')
+ except AttributeError:
+ self._script.generatorCache[self.KEY_BINDING][obj] = ["", "", ""]
+ return self._script.generatorCache[self.KEY_BINDING][obj]
if len(bindingStrings) == 3:
mnemonic = bindingStrings[0]
diff --git a/src/orca/structural_navigation.py b/src/orca/structural_navigation.py
index 15f2a85..f609873 100644
--- a/src/orca/structural_navigation.py
+++ b/src/orca/structural_navigation.py
@@ -1174,7 +1174,9 @@ class StructuralNavigation:
index = obj.getIndexInParent() - 1
if index >= 0:
prevObj = obj.parent[index]
- if prevObj.childCount:
+ if not prevObj:
+ debug.println(debug.LEVEL_FINE, 'Error: Dead Accessible')
+ elif prevObj.childCount:
prevObj = prevObj[prevObj.childCount - 1]
elif not self._script.utilities.isSameObject(obj.parent, stopAncestor):
prevObj = obj.parent
@@ -1205,6 +1207,9 @@ class StructuralNavigation:
index = obj.getIndexInParent() + 1
if 0 < index < obj.parent.childCount:
nextObj = obj.parent[index]
+ if not nextObj:
+ debug.println(debug.LEVEL_FINE, 'Error: Dead Accessible')
+ break
elif not self._script.utilities.isSameObject(
obj.parent, stopAncestor):
obj = obj.parent
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]