[orca] Handle traceback when asking for the name of a defunct object



commit a5362e0ae9a99e63f1525d397c8d3164ab5bc42d
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Mon Jun 8 17:57:46 2015 -0400

    Handle traceback when asking for the name of a defunct object

 src/orca/speech_generator.py |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/src/orca/speech_generator.py b/src/orca/speech_generator.py
index 07b8b25..3f22386 100644
--- a/src/orca/speech_generator.py
+++ b/src/orca/speech_generator.py
@@ -191,8 +191,14 @@ class SpeechGenerator(generator.Generator):
         acss = self.voice(DEFAULT)
         result.extend(self._generateLabel(obj, **args))
         if not result:
-            if obj.name and (len(obj.name)):
-                result.append(obj.name)
+            try:
+                name = obj.name
+            except:
+                msg = 'ERROR: Could not get name for %s' % obj
+                debug.println(debug.LEVEL_INFO, msg)
+                return result
+            if name:
+                result.append(name)
                 result.extend(acss)
         if not result and obj.parent.getRole() == pyatspi.ROLE_AUTOCOMPLETE:
             result = self._generateLabelOrName(obj.parent, **args)


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