summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--ranger/container/bookmarks.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/ranger/container/bookmarks.py b/ranger/container/bookmarks.py
index cbfc541a..e1a88fa2 100644
--- a/ranger/container/bookmarks.py
+++ b/ranger/container/bookmarks.py
@@ -88,7 +88,12 @@ class Bookmarks(FileManagerAware):
         if key == '`':
             key = "'"
         if key in self.dct:
-            return self.dct[key]
+            value = self.dct[key]
+            if os.path.isdir(value.path):
+                return value
+            else:
+                del self[key]
+                raise KeyError("Invalid Bookmark: `%s'!" % key)
         else:
             raise KeyError("Nonexistant Bookmark: `%s'!" % key)
 
@@ -229,7 +234,7 @@ class Bookmarks(FileManagerAware):
         for line in fobj:
             if self.load_pattern.match(line):
                 key, value = line[0], line[2:-1]
-                if key in ALLOWED_KEYS and not os.path.isfile(value):
+                if key in ALLOWED_KEYS:
                     dct[key] = self.bookmarktype(value)
         fobj.close()
         return dct