about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorBen Burwell <ben@benburwell.com>2019-07-31 14:21:13 -0400
committerDrew DeVault <sir@cmpwn.com>2019-08-02 09:34:10 -0400
commitc9a909fee3d79917589f46ebd7c7453afb33bf1c (patch)
tree655ea99313fd4302b28e79ceca387c1c275b340c
parentbb620e09004e63699562c0533645bf8cfd865097 (diff)
downloadaerc-c9a909fee3d79917589f46ebd7c7453afb33bf1c.tar.gz
Fix sending attachments with less than 512 bytes
-rw-r--r--widgets/compose.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/widgets/compose.go b/widgets/compose.go
index 03b6586..a0a5259 100644
--- a/widgets/compose.go
+++ b/widgets/compose.go
@@ -409,7 +409,7 @@ func writeAttachment(path string, writer *mail.Writer) error {
 	// determine the MIME type
 	// http.DetectContentType only cares about the first 512 bytes
 	head, err := reader.Peek(512)
-	if err != nil {
+	if err != nil && err != io.EOF {
 		return errors.Wrap(err, "Peek")
 	}