1
Fork 0

Fix wrap nil error

In this case ReadVideoStreamMetadata return nil, nil because: 

func Wrap(err error, message string) error {
	if err == nil {
		return nil
	}
	.....
}
This commit is contained in:
bzzim 2024-09-05 15:01:30 +05:00 committed by GitHub
parent 6e1e1d12ce
commit bee0787ed4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

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, errors.New(fmt.Sprintf("could not get stream from file metadata (%s)", path.Base(videoPath)))
}
return stream, nil