Skip to content

armgit / mwmbl

Public Imported from GitHub
0

An open source, non-profit web search engine

Add a comment explaining what we're doing

Daoud Clarke4ba25a77b433
diff --git a/mwmbl/tinysearchengine/indexer.py b/mwmbl/tinysearchengine/indexer.py
index 506b9b9..121b353 100644
--- a/mwmbl/tinysearchengine/indexer.py
+++ b/mwmbl/tinysearchengine/indexer.py
@@ -52,6 +52,8 @@ class Document:
state: Optional[int] = None
def __init__(self, title, url, extract, score, term=None, state=None):
+ # Sometimes the title or extract may be None, probably because of user generated content
+ # It's not allowed to be None though, or things will break
self.title = title if title is not None else ''
self.url = url
self.extract = extract if extract is not None else ''