aboutsummaryrefslogtreecommitdiff
path: root/outboxPost.go
diff options
context:
space:
mode:
authorFChannel <>2021-07-22 20:15:31 -0700
committerFChannel <>2021-07-22 20:15:31 -0700
commitc5eff11c39d0a07f5cb7401835d04ba4df9edcbf (patch)
tree4eb76e3e606f1954cf2ee381f51cd8bd7be4af51 /outboxPost.go
parent16b4165e5102fc9b4766e1bd1204ca9cf23199aa (diff)
null reference
Diffstat (limited to 'outboxPost.go')
-rw-r--r--outboxPost.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/outboxPost.go b/outboxPost.go
index a827e21..b3a8baf 100644
--- a/outboxPost.go
+++ b/outboxPost.go
@@ -25,9 +25,9 @@ func ParseOutboxRequest(w http.ResponseWriter, r *http.Request, db *sql.DB) {
r.ParseMultipartForm(5 << 20)
if(BoardHasAuthType(db, actor.Name, "captcha") && CheckCaptcha(db, r.FormValue("captcha"))) {
f, header, _ := r.FormFile("file")
- defer f.Close()
-
+
if(header != nil) {
+ defer f.Close()
if(header.Size > (7 << 20)){
w.WriteHeader(http.StatusRequestEntityTooLarge)
w.Write([]byte("7MB max file size"))