From: James Teh Date: Wed, 25 Jan 2012 05:45:14 +0000 (+1000) Subject: VirtualBuffer.shouldPassThrough: When walking ancestors, correctly handle the case... X-Git-Tag: jpdev130418~1122 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=7954d920416dfad98cf7082694f3e8db7c6e17eb;p=nvdajp%2Fnvdajp.git VirtualBuffer.shouldPassThrough: When walking ancestors, correctly handle the case where there are no more parents. This isn't supposed to happen, as it should hit the root NVDAObject before that. Nevertheless, we should handle it gracefully. --- diff --git a/source/virtualBuffers/__init__.py b/source/virtualBuffers/__init__.py index 057919833..bceb30c92 100644 --- a/source/virtualBuffers/__init__.py +++ b/source/virtualBuffers/__init__.py @@ -903,7 +903,7 @@ class VirtualBuffer(cursorManager.CursorManager, treeInterceptorHandler.TreeInte return True if reason == controlTypes.REASON_FOCUS: # If this is a focus change, pass through should be enabled for certain ancestor containers. - while obj != self.rootNVDAObject: + while obj and obj != self.rootNVDAObject: if obj.role == controlTypes.ROLE_TOOLBAR: return True obj = obj.parent