From a09831415f3d25480c3968feb10466fe9ece68b6 Mon Sep 17 00:00:00 2001 From: pictuga Date: Mon, 6 Apr 2020 18:53:07 +0200 Subject: [PATCH] feeds: fix bug when mimetype matches nothing --- morss/feeds.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/morss/feeds.py b/morss/feeds.py index 0cf7670..7485760 100644 --- a/morss/feeds.py +++ b/morss/feeds.py @@ -74,7 +74,7 @@ def parse(data, url=None, mimetype=None): if mimetype is not None: parser_candidates = [x for x in parsers if mimetype in x.mimetype] - if mimetype is None or parser_candidates is None: + if mimetype is None or len(parser_candidates) == 0: parser_candidates = parsers # 3) Look for working ruleset for given parser