diff options
author | hut <hut@lavabit.com> | 2011-10-03 04:41:05 +0200 |
---|---|---|
committer | hut <hut@lavabit.com> | 2011-10-03 04:41:05 +0200 |
commit | 1069340758a6dc425beefb9d3807a64026ba9641 (patch) | |
tree | 38554eaf2c80fddbc600d07e9277b43385ae2621 | |
parent | 0731aa8063b3ef72d64aaf3a6267c82a937b0d37 (diff) | |
download | ranger-1069340758a6dc425beefb9d3807a64026ba9641.tar.gz |
defaults.apps: safer sxiv handler
-rw-r--r-- | ranger/defaults/apps.py | 5 |
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 |