OSDN Git Service

VirtualBuffer.shouldPassThrough: When walking ancestors, correctly handle the case...
authorJames Teh <jamie@jantrid.net>
Wed, 25 Jan 2012 05:45:14 +0000 (15:45 +1000)
committerJames Teh <jamie@jantrid.net>
Wed, 25 Jan 2012 05:45:14 +0000 (15:45 +1000)
This isn't supposed to happen, as it should hit the root NVDAObject before that. Nevertheless, we should handle it gracefully.

source/virtualBuffers/__init__.py

index 0579198..bceb30c 100644 (file)
@@ -903,7 +903,7 @@ class VirtualBuffer(cursorManager.CursorManager, treeInterceptorHandler.TreeInte
                        return True\r
                if reason == controlTypes.REASON_FOCUS:\r
                        # If this is a focus change, pass through should be enabled for certain ancestor containers.\r
-                       while obj != self.rootNVDAObject:\r
+                       while obj and obj != self.rootNVDAObject:\r
                                if obj.role == controlTypes.ROLE_TOOLBAR:\r
                                        return True\r
                                obj = obj.parent\r