summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2010-08-16 22:35:03 +0200
committerhut <hut@lavabit.com>2010-08-16 22:35:03 +0200
commitfd51fa3da2848859ba722bac45178c24845d17d0 (patch)
tree3a6051dd4a5504ae4b5d2ffbddff27f45050ec30
parentc2a8c862631cb7301e173795273a363aa5913834 (diff)
downloadranger-fd51fa3da2848859ba722bac45178c24845d17d0.tar.gz
Fixed exception when using %f macros in special cases
-rw-r--r--ranger/gui/widgets/console.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/ranger/gui/widgets/console.py b/ranger/gui/widgets/console.py
index f02a4b01..ff8d137a 100644
--- a/ranger/gui/widgets/console.py
+++ b/ranger/gui/widgets/console.py
@@ -498,7 +498,8 @@ class OpenConsole(ConsoleWithTab):
 			tab_dir = self.fm.env.get_directory(tab_dir_path)
 			i = str(i)
 			macros[i + 'd'] = shell_quote(tab_dir_path)
-			macros[i + 'f'] = shell_quote(tab_dir.pointed_obj.path)
+			if tab_dir.pointed_obj:
+				macros[i + 'f'] = shell_quote(tab_dir.pointed_obj.path)
 			macros[i + 's'] = ' '.join(shell_quote(fl.path)
 				for fl in tab_dir.get_selection())
 
@@ -519,7 +520,8 @@ class OpenConsole(ConsoleWithTab):
 		next_tab = self.fm.env.get_directory(next_tab_path)
 
 		macros['D'] = shell_quote(next_tab)
-		macros['F'] = shell_quote(next_tab.pointed_obj.path)
+		if next_tab.pointed_obj:
+			macros['F'] = shell_quote(next_tab.pointed_obj.path)
 		macros['S'] = ' '.join(shell_quote(fl.path)
 			for fl in next_tab.get_selection())