From 4ff7612a27065047b17ff96560d88334c3988f58 Mon Sep 17 00:00:00 2001 From: Ben Kurtovic Date: Wed, 5 Sep 2012 10:10:18 -0400 Subject: [PATCH] Fix when we've cached None as a url. --- earwigbot/wiki/copyvios/__init__.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/earwigbot/wiki/copyvios/__init__.py b/earwigbot/wiki/copyvios/__init__.py index 906c2f5..cd0d143 100644 --- a/earwigbot/wiki/copyvios/__init__.py +++ b/earwigbot/wiki/copyvios/__init__.py @@ -230,8 +230,13 @@ class CopyvioMixIn(object): content = self.get() clean = ArticleTextParser(content).strip() article_chain = MarkovChain(clean) - confidence, chains = self._copyvio_compare_content(article_chain, url) + if not url: + empty = MarkovChain("") + chns = (empty, MarkovChainIntersection(empty, empty)) + return CopyvioCheckResult(False, 0, url, 0, 0, article_chain, chns) + + confidence, chains = self._copyvio_compare_content(article_chain, url) ctime = time() - start_time if confidence >= min_confidence: is_violation = True