From a78a5d1bf8d0f43fd98c1341952bccefcabf6d11 Mon Sep 17 00:00:00 2001 From: ze0s <43699394+zze0s@users.noreply.github.com> Date: Tue, 26 Sep 2023 20:33:36 +0200 Subject: [PATCH] fix(indexers): API get torrent check for nil body (#1146) --- internal/indexer/api.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/indexer/api.go b/internal/indexer/api.go index df32231..7f944cf 100644 --- a/internal/indexer/api.go +++ b/internal/indexer/api.go @@ -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