fix(indexers): API get torrent check for nil body (#1146)

This commit is contained in:
ze0s 2023-09-26 20:33:36 +02:00 committed by GitHub
parent 657c966ecb
commit a78a5d1bf8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -58,6 +58,10 @@ func (s *apiService) GetTorrentByID(ctx context.Context, indexer string, torrent
return nil, err
}
if torrent == nil {
return nil, errors.New("could not get torrent: %s from: %s", torrentID, indexer)
}
s.log.Trace().Str("method", "GetTorrentByID").Msgf("%s api successfully fetched torrent: %+v", indexer, torrent)
return torrent, nil