about summary refs log tree commit diff stats
path: root/ranger
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2011-09-29 03:33:59 +0200
committerhut <hut@lavabit.com>2011-09-29 03:33:59 +0200
commit0f30fdab1baac5ab45a8fafd398f581e463819bb (patch)
tree99767d97afd35272fc9078e2387cb28ef9d9f651 /ranger
parentef5fe778f88d43b8bee931cc3763ed0a63dba33b (diff)
downloadranger-0f30fdab1baac5ab45a8fafd398f581e463819bb.tar.gz
core.actions: Fixed error message in move_parent
self.env.at_level(-1) is None when path == '/'
Diffstat (limited to 'ranger')
-rw-r--r--ranger/core/actions.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/ranger/core/actions.py b/ranger/core/actions.py
index 4353aabf..05f81330 100644
--- a/ranger/core/actions.py
+++ b/ranger/core/actions.py
@@ -230,12 +230,13 @@ class Actions(FileManagerAware, EnvironmentAware, SettingsAware):
 		if narg is not None:
 			n *= narg
 		parent = self.env.at_level(-1)
-		if parent.pointer + n < 0:
-			n = 0 - parent.pointer
-		try:
-			self.env.enter_dir(parent.files[parent.pointer+n])
-		except IndexError:
-			pass
+		if parent is not None:
+			if parent.pointer + n < 0:
+				n = 0 - parent.pointer
+			try:
+				self.env.enter_dir(parent.files[parent.pointer+n])
+			except IndexError:
+				pass
 
 	def history_go(self, relative):
 		"""Move back and forth in the history"""