OSDN Git Service

VirtualBuffer._activatePosition: Gracefully handle the case where there is no object...
authorJames Teh <jamie@jantrid.net>
Mon, 15 Oct 2012 03:53:37 +0000 (13:53 +1000)
committerJames Teh <jamie@jantrid.net>
Mon, 15 Oct 2012 03:53:37 +0000 (13:53 +1000)
Fixes exception when pressing enter in an empty buffer.
Fixes #2714.

source/virtualBuffers/__init__.py

index 77bfe75..7c54539 100644 (file)
@@ -759,6 +759,8 @@ class VirtualBuffer(cursorManager.CursorManager, treeInterceptorHandler.TreeInte
 \r
        def _activatePosition(self, info):\r
                obj = info.NVDAObjectAtStart\r
+               if not obj:\r
+                       return\r
                if self.shouldPassThrough(obj):\r
                        obj.setFocus()\r
                        self.passThrough = True\r