Fix crash in attachment handling when we close on error
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user