about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--ranger/core/actions.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/ranger/core/actions.py b/ranger/core/actions.py
index 435fcf13..00394be5 100644
--- a/ranger/core/actions.py
+++ b/ranger/core/actions.py
@@ -303,9 +303,9 @@ class Actions(  # pylint: disable=too-many-instance-attributes,too-many-public-m
             macros['datadir'] = self.fm.datapath()
         macros['space'] = ' '
 
-        if self.fm.thisfile:
+        try:
             macros['f'] = self.fm.thisfile.relative_path
-        else:
+        except AttributeError:
             macros['f'] = MACRO_FAIL
 
         if self.fm.thistab.get_selection: