Index: src/orca/Gecko.py
===================================================================
--- src/orca/Gecko.py	(revision 2698)
+++ src/orca/Gecko.py	(working copy)
@@ -5042,6 +5042,8 @@
 
         if obj.role == rolenames.ROLE_HEADING:
             attributes = obj.attributes
+            if attributes is None:
+                return level
             for attribute in attributes:
                 if attribute.startswith("level:"):
                     level = int(attribute.split(":")[1])
@@ -5055,6 +5057,8 @@
         this value is 0-based (Gecko return is 1-based) """
         
         attrs = obj.attributes
+        if attrs is None:
+            return -1
         for attr in attrs:
             if attr.startswith("level:"):
                 return int(attr[6:]) - 1
