Index: src/orca/Gecko.py
===================================================================
--- src/orca/Gecko.py	(revision 3501)
+++ src/orca/Gecko.py	(working copy)
@@ -8104,11 +8104,11 @@
                                                                characterOffset)
             if obj and obj.getState().contains(pyatspi.STATE_VISIBLE):
                 break
-        if obj:
-            self.setCaretPosition(obj, characterOffset)
-        else:
-            self.clearCaretContext()
 
+        if not obj:
+            [obj, characterOffset] = self.getBottomOfFile()
+
+        self.setCaretPosition(obj, characterOffset)
         self.updateBraille(obj)
         self.speakCharacterAtOffset(obj, characterOffset)
 
@@ -8123,11 +8123,10 @@
             if obj and obj.getState().contains(pyatspi.STATE_VISIBLE):
                 break
 
-        if obj:
-            self.setCaretPosition(obj, characterOffset)
-        else:
-            self.clearCaretContext()
+        if not obj:
+            [obj, characterOffset] = self.getTopOfFile()
 
+        self.setCaretPosition(obj, characterOffset)
         self.updateBraille(obj)
         self.speakCharacterAtOffset(obj, characterOffset)
 
