Update file_info.go (fix errcheck issue) (#28966)

Co-authored-by: Ben Schumacher <ben.schumacher@mattermost.com>
Этот коммит содержится в:
TheInvincible
2024-11-14 08:42:32 +01:00
коммит произвёл GitHub
родитель e7e1d7d7ce
Коммит 45235a0ef6
3 изменённых файлов: 7 добавлений и 2 удалений

Просмотреть файл

@@ -92,7 +92,6 @@ issues:
channels/app/export_test.go|\
channels/app/file.go|\
channels/app/file_bench_test.go|\
channels/app/file_info.go|\
channels/app/file_test.go|\
channels/app/helper_test.go|\
channels/app/import_functions.go|\

Просмотреть файл

@@ -40,7 +40,9 @@ func getInfoForBytes(name string, data io.ReadSeeker, size int) (*model.FileInfo
if info.MimeType == "image/gif" {
// Just show the gif itself instead of a preview image for animated gifs
data.Seek(0, io.SeekStart)
if _, err := data.Seek(0, io.SeekStart); err != nil {
return info, model.NewAppError("getInfoForBytes", "app.file_info.seek.gif.app_error", nil, "", http.StatusBadRequest).Wrap(err)
}
frameCount, err := imgutils.CountGIFFrames(data)
if err != nil {
// Still return the rest of the info even though it doesn't appear to be an actual gif

Просмотреть файл

@@ -5162,6 +5162,10 @@
"id": "app.file_info.save.app_error",
"translation": "Unable to save the file info."
},
{
"id": "app.file_info.seek.gif.app_error",
"translation": "Unable to seek to the beginning of the GIF data."
},
{
"id": "app.file_info.set_searchable_content.app_error",
"translation": "Unable to set the searchable content of the file."