From c9a909fee3d79917589f46ebd7c7453afb33bf1c Mon Sep 17 00:00:00 2001 From: Ben Burwell Date: Wed, 31 Jul 2019 14:21:13 -0400 Subject: Fix sending attachments with less than 512 bytes --- widgets/compose.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/widgets/compose.go b/widgets/compose.go index 03b65860..a0a5259c 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") } -- cgit