about summary refs log tree commit diff stats
path: root/ranger/container/environment.py
diff options
context:
space:
mode:
Diffstat (limited to 'ranger/container/environment.py')
-rw-r--r--ranger/container/environment.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/ranger/container/environment.py b/ranger/container/environment.py
index a6d291cf..11c0082b 100644
--- a/ranger/container/environment.py
+++ b/ranger/container/environment.py
@@ -1,4 +1,4 @@
-from os.path import abspath, normpath, join, expanduser
+from os.path import abspath, normpath, join, expanduser, isdir
 from ranger.fsobject.directory import Directory, NoDirectoryGiven
 from ranger.container import KeyBuffer, History
 from ranger.shared import SettingsAware
@@ -91,6 +91,9 @@ level <0 => parent directories"""
 		# get the absolute path
 		path = normpath(join(self.path, expanduser(path)))
 
+		if not isdir(path):
+			return
+
 		try:
 			new_pwd = self.get_directory(path)
 		except NoDirectoryGiven: