summary refs log tree commit diff stats
path: root/lib/ui
diff options
context:
space:
mode:
authorAndreas Rammhold <andreas@rammhold.de>2020-02-06 12:47:38 +0100
committerDrew DeVault <sir@cmpwn.com>2020-02-07 10:40:37 -0500
commitaed847f9ebf5e1d7301b5965e5d5c405a62453fe (patch)
tree76871dfbd25b6e38fa4b812690b233be8c503b73 /lib/ui
parent8c8096da9728870bd8d39ec22e3fd8d14f44912d (diff)
downloadaerc-aed847f9ebf5e1d7301b5965e5d5c405a62453fe.tar.gz
Ensure we aren't selecting negative directories
When the list of directories is empty trying to navigate in the
directory list did previously lead to a crash. With this change we
instead return early before trying to change the directory.

Example backtrace:

> panic: runtime error: index out of range [-1]
>
> goroutine 1 [running]:
> git.sr.ht/~sircmpwn/aerc/widgets.(*DirectoryList).NextPrev(0xc000160680, 0xffffffffffffffff)
> 	source/aerc/widgets/dirlist.go:285 +0xd4
> git.sr.ht/~sircmpwn/aerc/commands/account.NextPrevFolder.Execute(0xc000191040, 0xc00025c210, 0x1, 0x1, 0x0, 0xc00016f420)
> 	source/aerc/commands/account/next-folder.go:44 +0xe0
> git.sr.ht/~sircmpwn/aerc/commands.(*Commands).ExecuteCommand(0xc0000101a8, 0xc000191040, 0xc00025c210, 0x1, 0x1, 0xc000020070, 0xb46d01)
> 	source/aerc/commands/commands.go:66 +0xa7
> main.execCommand(0xc000191040, 0xc0001ca190, 0xc00025c210, 0x1, 0x1, 0xc00025c210, 0xc0003fb080)
> 	source/aerc/aerc.go:60 +0xc7
> main.main.func3(0xc00025c210, 0x1, 0x1, 0x1, 0x1)
> 	source/aerc/aerc.go:162 +0x57
> git.sr.ht/~sircmpwn/aerc/widgets.(*Aerc).BeginExCommand.func1(0xc000201db0, 0xb)
> 	source/aerc/widgets/aerc.go:382 +0x83
> git.sr.ht/~sircmpwn/aerc/widgets.(*ExLine).Event(0xc0003be100, 0xb475a0, 0xc00023cba0, 0xc00023cba0)
> 	source/aerc/widgets/exline.go:79 +0x131
> git.sr.ht/~sircmpwn/aerc/widgets.(*Aerc).Event(0xc000191040, 0xb475a0, 0xc00023cba0, 0x99ee01)
> 	source/aerc/widgets/aerc.go:202 +0x4c1
> git.sr.ht/~sircmpwn/aerc/widgets.(*Aerc).simulate(0xc000191040, 0xc000036f00, 0xd, 0x10)
> 	source/aerc/widgets/aerc.go:195 +0x8d
> git.sr.ht/~sircmpwn/aerc/widgets.(*Aerc).Event(0xc000191040, 0xb475a0, 0xc00023c9c0, 0x9c5a60)
> 	source/aerc/widgets/aerc.go:218 +0x3e8
> git.sr.ht/~sircmpwn/aerc/lib/ui.(*UI).Tick(0xc0001ca190, 0xa99d00)
> 	source/aerc/lib/ui/ui.go:92 +0x190
> main.main()
> 	source/aerc/aerc.go:192 +0x5f2
Diffstat (limited to 'lib/ui')
0 files changed, 0 insertions, 0 deletions
artik.com> 2016-08-13 23:10:25 -0700 3183 - cleanup' href='/akkartik/mu/commit/087file.cc?h=main&id=734eef7c0ee9d4626aec7a44b5dbf1d1d92f010f'>734eef7c ^
dff1abb2 ^
2b250717 ^
dff1abb2 ^

78c50205 ^
734eef7c ^
dff1abb2 ^

ff16e04f ^
2b250717 ^
ff16e04f ^





a7c3f156 ^


734eef7c ^
23d3a022 ^
dff1abb2 ^




a7c3f156 ^



734eef7c ^
a7c3f156 ^
734eef7c ^
a7c3f156 ^
734eef7c ^
dff1abb2 ^
2b250717 ^
dff1abb2 ^

78c50205 ^
734eef7c ^
dff1abb2 ^

ff16e04f ^
2b250717 ^
ff16e04f ^





a7c3f156 ^


734eef7c ^
23d3a022 ^
dff1abb2 ^







734eef7c ^
dff1abb2 ^
734eef7c ^
dff1abb2 ^
734eef7c ^
dff1abb2 ^
2b250717 ^
dff1abb2 ^

dff1abb2 ^
734eef7c ^
dff1abb2 ^

10bbca64 ^
2b250717 ^
ff16e04f ^





10bbca64 ^



dff1abb2 ^


734eef7c ^
dff1abb2 ^





10bbca64 ^
dff1abb2 ^

10bbca64 ^
dff1abb2 ^






10bbca64 ^




dff1abb2 ^
fda86efe ^
dff1abb2 ^



10bbca64 ^
dff1abb2 ^

f4eee01a ^
f2043a73 ^
dff1abb2 ^

734eef7c ^
dff1abb2 ^
734eef7c ^
dff1abb2 ^
734eef7c ^
dff1abb2 ^
2b250717 ^
dff1abb2 ^

dff1abb2 ^
734eef7c ^
dff1abb2 ^

a621ef95 ^

dff1abb2 ^

ff16e04f ^
2b250717 ^
ff16e04f ^

dff1abb2 ^


734eef7c ^
dff1abb2 ^






















734eef7c ^
dff1abb2 ^
734eef7c ^
dff1abb2 ^
734eef7c ^
dff1abb2 ^
2b250717 ^
dff1abb2 ^

dff1abb2 ^
734eef7c ^
dff1abb2 ^

ff16e04f ^
2b250717 ^
ff16e04f ^


2b250717 ^
ff16e04f ^

dff1abb2 ^


734eef7c ^
dff1abb2 ^




a7c3f156 ^

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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225