From b241dd550888db0ddf89b3ad306ac5a2413d1694 Mon Sep 17 00:00:00 2001 From: A nyaa developer Date: Mon, 22 May 2017 20:08:41 +0200 Subject: [PATCH] Don't generate empty torrent file for torrents without info dict (has_torrent). --- nyaa/routes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nyaa/routes.py b/nyaa/routes.py index 013d842..d7340cb 100644 --- a/nyaa/routes.py +++ b/nyaa/routes.py @@ -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))