about summary refs log tree commit diff stats
path: root/widgets
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2019-03-17 14:57:05 -0400
committerDrew DeVault <sir@cmpwn.com>2019-03-17 14:57:05 -0400
commit9e28a02f6a4345ec7b5fdee68864610186f34e91 (patch)
tree866940888523f3cafa649697d088c4e016014662 /widgets
parentbd71787e3fa9caf53f18dab37c4f37a2631b2354 (diff)
downloadaerc-9e28a02f6a4345ec7b5fdee68864610186f34e91.tar.gz
commands: handle case where no account selected
Diffstat (limited to 'widgets')
-rw-r--r--widgets/aerc.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/widgets/aerc.go b/widgets/aerc.go
index e7eebad..3537897 100644
--- a/widgets/aerc.go
+++ b/widgets/aerc.go
@@ -80,5 +80,9 @@ func (aerc *Aerc) Event(event tcell.Event) bool {
 }
 
 func (aerc *Aerc) SelectedAccount() *AccountView {
-	return aerc.accounts[aerc.tabs.Tabs[aerc.tabs.Selected].Name]
+	acct, ok := aerc.accounts[aerc.tabs.Tabs[aerc.tabs.Selected].Name]
+	if !ok {
+		return nil
+	}
+	return acct
 }
^
79328f9a ^
8188bbbc ^
33352536 ^
7dac9ade ^
79328f9a ^

71eb22a5 ^
7a583220 ^
33352536 ^

79328f9a ^


33352536 ^
79328f9a ^


33352536 ^
79328f9a ^

33352536 ^

79328f9a ^


33352536 ^
79328f9a ^


33352536 ^
79328f9a ^


33352536 ^
05dabd81 ^
79328f9a ^
33352536 ^

79328f9a ^
05dabd81 ^
79328f9a ^
33352536 ^
79328f9a ^


33352536 ^
79328f9a ^


33352536 ^
2a2a5b1e ^
79328f9a ^
33352536 ^
79328f9a ^


33352536 ^
79328f9a ^


33352536 ^
79328f9a ^



7a583220 ^
33352536 ^

79328f9a ^


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