summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--ranger/config/commands.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/ranger/config/commands.py b/ranger/config/commands.py
index 74d306e8..f5f5b03d 100644
--- a/ranger/config/commands.py
+++ b/ranger/config/commands.py
@@ -514,6 +514,9 @@ class delete(Command):
 
 		cwd = self.fm.thisdir
 		cf = self.fm.thisfile
+		if not cwd or not cf:
+			self.fm.notify("Error: no file selected for deletion!", bad=True)
+			return
 
 		confirm = self.fm.settings.confirm_on_delete
 		many_files = (cwd.marked_items or (cf.is_directory and not cf.is_link \