3
0

Fix crash in attachment handling when we close on error

This commit is contained in:
Denis Arh
2022-09-30 12:42:55 +02:00
parent e95970d33d
commit 5c96a2b2f2

View File

@@ -118,13 +118,13 @@ func (ctrl Attachment) serve(ctx context.Context, attachmentID uint64, preview,
fh, err = ctrl.attachment.OpenOriginal(att)
}
defer fh.Close()
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
return
}
defer fh.Close()
name := url.QueryEscape(att.Name)
if download {