mirror of
https://github.com/osmarks/mycorrhiza.git
synced 2024-12-12 05:20:26 +00:00
Allow empty content for an attachful hypha
This commit is contained in:
parent
44f6fbe0b2
commit
6636fc95a7
@ -5,6 +5,7 @@ import (
|
||||
"fmt"
|
||||
"io"
|
||||
"log"
|
||||
"bytes"
|
||||
"mime/multipart"
|
||||
"os"
|
||||
"path/filepath"
|
||||
@ -35,7 +36,7 @@ func UploadText(h *hyphae.Hypha, data []byte, message string, u *user.User) (hop
|
||||
if err, errtitle := CanEdit(u, h); err != nil {
|
||||
return hop.WithErrAbort(err), errtitle
|
||||
}
|
||||
if len(data) == 0 {
|
||||
if len(bytes.TrimSpace(data)) == 0 && h.BinaryPath == "" {
|
||||
return hop.WithErrAbort(errors.New("No data passed")), "Empty"
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user