diff options
author | Jesús Espino <jespinog@gmail.com> | 2018-09-25 14:42:06 +0200 |
---|---|---|
committer | Joram Wilander <jwawilander@gmail.com> | 2018-09-25 08:42:06 -0400 |
commit | 7636650a25462b0eb3e1ca2f35d8c0d914c40820 (patch) | |
tree | 705d570d340436f39c3ae062558df6cea6fced75 /app/brand.go | |
parent | 3785ad48c14c2ab9a8c55127b2f2a04cd8b30d6e (diff) | |
download | chat-7636650a25462b0eb3e1ca2f35d8c0d914c40820.tar.gz chat-7636650a25462b0eb3e1ca2f35d8c0d914c40820.tar.bz2 chat-7636650a25462b0eb3e1ca2f35d8c0d914c40820.zip |
Migrate to idiomatic error handling app/a*.go and app/b*.go (#9455)
Diffstat (limited to 'app/brand.go')
-rw-r--r-- | app/brand.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/app/brand.go b/app/brand.go index f01393125..a2feac7ec 100644 --- a/app/brand.go +++ b/app/brand.go @@ -36,7 +36,9 @@ func (a *App) SaveBrandImage(imageData *multipart.FileHeader) *model.AppError { config, _, err := image.DecodeConfig(file) if err != nil { return model.NewAppError("SaveBrandImage", "brand.save_brand_image.decode_config.app_error", nil, err.Error(), http.StatusBadRequest) - } else if config.Width*config.Height > model.MaxImageSize { + } + + if config.Width*config.Height > model.MaxImageSize { return model.NewAppError("SaveBrandImage", "brand.save_brand_image.too_large.app_error", nil, err.Error(), http.StatusBadRequest) } |