summaryrefslogtreecommitdiffstats
path: root/api4/system.go
diff options
context:
space:
mode:
Diffstat (limited to 'api4/system.go')
-rw-r--r--api4/system.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/api4/system.go b/api4/system.go
index f3278a7b5..7bc846766 100644
--- a/api4/system.go
+++ b/api4/system.go
@@ -315,11 +315,11 @@ func addLicense(c *Context, w http.ResponseWriter, r *http.Request) {
fileData := fileArray[0]
file, err := fileData.Open()
- defer file.Close()
if err != nil {
c.Err = model.NewAppError("addLicense", "api.license.add_license.open.app_error", nil, err.Error(), http.StatusBadRequest)
return
}
+ defer file.Close()
buf := bytes.NewBuffer(nil)
io.Copy(buf, file)