[orca] Be sure we have an object with a parent before trying to get the language



commit 881fde03d47d7e0d7027fc1d8b0a7be1fd3393fb
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Tue Jan 11 15:58:18 2022 +0100

    Be sure we have an object with a parent before trying to get the language

 src/orca/scripts/web/script_utilities.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/src/orca/scripts/web/script_utilities.py b/src/orca/scripts/web/script_utilities.py
index 462e4b4dc..f60114520 100644
--- a/src/orca/scripts/web/script_utilities.py
+++ b/src/orca/scripts/web/script_utilities.py
@@ -946,7 +946,7 @@ class Utilities(script_utilities.Utilities):
 
         # Embedded objects such as images and certain widgets won't implement the text interface
         # and thus won't expose text attributes. Therefore try to get the info from the parent.
-        if not rv:
+        if not rv and obj and obj.parent:
             start, end = self.getHyperlinkRange(obj)
             language, dialect = self.getLanguageAndDialectForSubstring(obj.parent, start, end)
             rv.append((0, 1, language, dialect))


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