]> code.communitydata.science - mediawiki_dump_tools.git/blobdiff - wikiq
updated README file
[mediawiki_dump_tools.git] / wikiq
diff --git a/wikiq b/wikiq
index 4a5c129a1078722e58dea1ae99435ef86a5c4ec4..2c1ef3857e9cd5c02e09000fae3ab9125853cf64 100755 (executable)
--- a/wikiq
+++ b/wikiq
@@ -146,7 +146,7 @@ class RegexPair(object):
         if self.has_groups:
 
             # if there are matches of some sort in this revision content, fill the lists for each cap_group
-            if self.pattern.search(content) is not None:
+            if content is not None and self.pattern.search(content) is not None:
                 m = self.pattern.finditer(content)
                 matchobjects = list(m)
 
@@ -174,7 +174,7 @@ class RegexPair(object):
         # there are no capture groups, we just search for all the matches of the regex
         else:
             #given that there are matches to be made
-            if self.pattern.search(content) is not None:
+            if content is not None and self.pattern.search(content) is not None:
                 m = self.pattern.findall(content)
                 temp_dict[self.label] = ', '.join(m)
             else:

Community Data Science Collective || Want to submit a patch?