summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--ranger/defaults/apps.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/ranger/defaults/apps.py b/ranger/defaults/apps.py
index 77bc9c2b..63d53b79 100644
--- a/ranger/defaults/apps.py
+++ b/ranger/defaults/apps.py
@@ -171,7 +171,10 @@ class CustomApplications(Applications):
 		c.flags = 'd' + c.flags
 		if len(c.files) is 1:
 			images = [f.basename for f in self.fm.env.cwd.files if f.image]
-			position = images.index(c.file.basename) + 1
+			try:
+				position = images.index(c.file.basename) + 1
+			except:
+				return None
 			return 'sxiv', '-n', str(position), images
 		return 'sxiv', c