summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
authorReto Brunner <reto@labrat.space>2020-08-24 23:01:18 +0200
committerReto Brunner <reto@labrat.space>2020-08-24 23:28:18 +0200
commitb6ef116c36e1a1de6a2289f392603fd51a2b91da (patch)
treee78c459a69f78ac0e88f86c7633831e2be6e5c30 /lib
parenteb1439c2417a7f85c80249d63821e10027d7d329 (diff)
downloadaerc-b6ef116c36e1a1de6a2289f392603fd51a2b91da.tar.gz
ParseAddressList: return empty list if "" is provided
Go 1.15 handles "" in the address parser as a non error case, returning
an empty list.
Prior versions returned an error, which is not what we want.

Reported-by: anianz <a.ziegler@cioplenu.de>
Tested-by: anianz <a.ziegler@cioplenu.de>
Diffstat (limited to 'lib')
-rw-r--r--lib/format/format.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/format/format.go b/lib/format/format.go
index 656d808..0eda7ae 100644
--- a/lib/format/format.go
+++ b/lib/format/format.go
@@ -21,6 +21,12 @@ func ParseAddress(address string) (*models.Address, error) {
 }
 
 func ParseAddressList(s string) ([]*models.Address, error) {
+	if len(s) == 0 {
+		// workaround for go versions < 1.15
+		// 1.15 returns an empty list if "" is provided as input, prior versions
+		// return an error which is not what we want
+		return nil, nil
+	}
 	parser := gomail.AddressParser{
 		&mime.WordDecoder{message.CharsetReader},
 	}
' href='/danisanti/profani-tty/blame/themes/joker?id=7bdc46c012e58df98ac68b6e7a8bbbcb3452958e'>^
6dabbbd5 ^


6dabbbd5 ^
30b5f112 ^
2f82f50a ^
86c1c388 ^
1a3dc91e ^
6dabbbd5 ^

30b5f112 ^
fbc30231 ^

















cd2458c0 ^

0ae975c2 ^

b21edfaa ^
cd2458c0 ^
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