summary refs log tree commit diff stats
path: root/ranger
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2012-03-05 12:22:02 +0100
committerhut <hut@lavabit.com>2012-03-05 12:22:02 +0100
commit9dde8e361b0b71d1aa6bb5086313b90f5fc25dd5 (patch)
tree80cb65a50ac59522970810fbc5516b4bc43cb8b7 /ranger
parente1155824b39d584beb8c178ceca8999eb7783daf (diff)
downloadranger-9dde8e361b0b71d1aa6bb5086313b90f5fc25dd5.tar.gz
Fix crash when opening files with feh or sxiv with "ranger <image>"
Diffstat (limited to 'ranger')
-rw-r--r--ranger/defaults/apps.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/ranger/defaults/apps.py b/ranger/defaults/apps.py
index fbcc83c0..1619eb1e 100644
--- a/ranger/defaults/apps.py
+++ b/ranger/defaults/apps.py
@@ -226,7 +226,8 @@ class CustomApplications(Applications):
 	@depends_on('feh', 'X')
 	def app_feh(self, c):
 		c.flags += 'd'
-		if c.mode is 0 and len(c.files) is 1: # view all files in the cwd
+		if c.mode is 0 and len(c.files) is 1 and self.fm.env.cwd:
+			# view all files in the cwd
 			images = [f.basename for f in self.fm.env.cwd.files if f.image]
 			return 'feh', '--start-at', c.file.basename, images
 		return 'feh', c
@@ -234,7 +235,7 @@ class CustomApplications(Applications):
 	@depends_on('sxiv', 'X')
 	def app_sxiv(self, c):
 		c.flags = 'd' + c.flags
-		if len(c.files) is 1:
+		if len(c.files) is 1 and self.fm.env.cwd:
 			images = [f.basename for f in self.fm.env.cwd.files if f.image]
 			try:
 				position = images.index(c.file.basename) + 1
span> ^
976e5aac ^
30b5f112 ^








976e5aac ^
b21dc543 ^
976e5aac ^
20fa9632 ^
b21dc543 ^
20fa9632 ^
30b5f112 ^
26840cc3 ^


02a4beb6 ^
976e5aac ^
26840cc3 ^
976e5aac ^
976e5aac ^
fbc30231 ^

















cd2458c0 ^

71a8e391 ^
b21edfaa ^
20fa9632 ^

20fa9632 ^
84f441b9 ^
30b5f112 ^

06afcb59 ^





1900402f ^
99fc70bd ^
20fa9632 ^

30b5f112 ^
446027b9 ^
30b5f112 ^



6e4a9de6 ^
216493ef ^
0a022618 ^
6e4a9de6 ^
216493ef ^
0a022618 ^
cce01f1d ^
0a022618 ^
56751e89 ^
0a022618 ^
216493ef ^

0a022618 ^
216493ef ^




0a022618 ^
216493ef ^
cf80fdc3 ^
97d96746 ^
cce01f1d ^
30b5f112 ^

3892665f ^
f0f3a739 ^
35239ee3 ^

93358d5e ^
fb7001cf ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123