diff options
author | Chris <ccbrown112@gmail.com> | 2017-11-03 10:25:38 -0500 |
---|---|---|
committer | Corey Hulen <corey@hulen.com> | 2017-11-03 08:25:38 -0700 |
commit | d5dbdb273703a3add0f1c3287aa531854ab30269 (patch) | |
tree | 6b1fb9079f9fae9d25bdb7ea459261383ee720d6 /app/user.go | |
parent | 9d32cd42085bbb37460d815c6c1a00ad881c4895 (diff) | |
download | chat-d5dbdb273703a3add0f1c3287aa531854ab30269.tar.gz chat-d5dbdb273703a3add0f1c3287aa531854ab30269.tar.bz2 chat-d5dbdb273703a3add0f1c3287aa531854ab30269.zip |
several one-line panic, race, and logic fixes (#7766)
Diffstat (limited to 'app/user.go')
-rw-r--r-- | app/user.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/user.go b/app/user.go index 9f74ef303..999fabbf8 100644 --- a/app/user.go +++ b/app/user.go @@ -774,10 +774,10 @@ func (a *App) GetProfileImage(user *model.User) ([]byte, bool, *model.AppError) func (a *App) SetProfileImage(userId string, imageData *multipart.FileHeader) *model.AppError { file, err := imageData.Open() - defer file.Close() if err != nil { return model.NewAppError("SetProfileImage", "api.user.upload_profile_user.open.app_error", nil, err.Error(), http.StatusBadRequest) } + defer file.Close() // Decode image config first to check dimensions before loading the whole thing into memory later on config, _, err := image.DecodeConfig(file) |