Don't generate empty torrent file for torrents without info dict (has_torrent).

This commit is contained in:
A nyaa developer 2017-05-22 20:08:41 +02:00 committed by GitHub
parent 607d9b2c92
commit b241dd5508
1 changed files with 1 additions and 1 deletions

View File

@ -679,7 +679,7 @@ def redirect_magnet(torrent_id):
def download_torrent(torrent_id):
torrent = models.Torrent.by_id(torrent_id)
if not torrent:
if not torrent or not torrent.has_torrent:
flask.abort(404)
resp = flask.Response(_get_cached_torrent_file(torrent))