diff --git a/server/resources.go b/server/resources.go index 0d13625..b11b420 100644 --- a/server/resources.go +++ b/server/resources.go @@ -123,6 +123,9 @@ func (s *Server) SearchTvAndDownload(c *gin.Context) (interface{}, error) { if err != nil { return nil, errors.Wrap(err, "download") } + if len(name1) == 0 { + return nil, fmt.Errorf("no torrent found") + } name = name1[0] }