summary refs log tree commit diff stats
path: root/ranger
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2011-10-03 04:41:05 +0200
committerhut <hut@lavabit.com>2011-10-03 04:41:05 +0200
commit1069340758a6dc425beefb9d3807a64026ba9641 (patch)
tree38554eaf2c80fddbc600d07e9277b43385ae2621 /ranger
parent0731aa8063b3ef72d64aaf3a6267c82a937b0d37 (diff)
downloadranger-1069340758a6dc425beefb9d3807a64026ba9641.tar.gz
defaults.apps: safer sxiv handler
Diffstat (limited to 'ranger')
-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