Fix wrap nil error (#1042)

* Fix wrap nil error

In this case ReadVideoStreamMetadata return nil, nil because: 

func Wrap(err error, message string) error {
	if err == nil {
		return nil
	}
	.....
}

* Update process_video_task.go
This commit is contained in:
bzzim
2024-10-14 17:16:58 +05:00
committed by GitHub
parent 4fc9edbd78
commit 2f13094d08

View File

@@ -225,7 +225,7 @@ func ReadVideoStreamMetadata(videoPath string) (*ffprobe.Stream, error) {
stream := data.FirstVideoStream()
if stream == nil {
return nil, errors.Wrapf(err, "could not get stream from file metadata (%s)", path.Base(videoPath))
return nil, fmt.Errorf("could not get stream from file metadata (%s)", path.Base(videoPath))
}
return stream, nil