From 41a7e8b896d83a935a8a104dc36aa3eea2212d21 Mon Sep 17 00:00:00 2001 From: Meisam <39205857+MFTabriz@users.noreply.github.com> Date: Sat, 31 Jul 2021 23:59:02 +0200 Subject: [PATCH] check the return value of os.Rename (#1288) --- core/transcoder/thumbnailGenerator.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/core/transcoder/thumbnailGenerator.go b/core/transcoder/thumbnailGenerator.go index 8da54c322..0ce2cf7e9 100644 --- a/core/transcoder/thumbnailGenerator.go +++ b/core/transcoder/thumbnailGenerator.go @@ -100,7 +100,9 @@ func fireThumbnailGenerator(segmentPath string, variantIndex int) error { return err } else { // rename temp file - os.Rename(outputFileTemp, outputFile) + if err := os.Rename(outputFileTemp, outputFile); err != nil { + log.Errorln(err) + } } // If YP support is enabled also create an animated GIF preview @@ -131,6 +133,8 @@ func makeAnimatedGifPreview(sourceFile string, outputFile string) { log.Errorln(err) } else { // rename temp file - os.Rename(outputFileTemp, outputFile) + if err := os.Rename(outputFileTemp, outputFile); err != nil { + log.Errorln(err) + } } }