Data sometimes can be apparently none, in that case return empty string

This commit is contained in:
Frisk 2021-04-14 15:47:10 +02:00
parent 5c63a48954
commit cb733ccb4b
No known key found for this signature in database
GPG key ID: 213F7C15068AF8AC

View file

@ -78,7 +78,7 @@ def link_formatter(link: str) -> str:
def escape_formatting(data: str) -> str:
"""Escape Discord formatting"""
return re.sub(r"([`_*~:<>{}@/|\\\[\]\(\)])", "\\\\\\1", data, 0)
return re.sub(r"([`_*~:<>{}@/|\\\[\]\(\)])", "\\\\\\1", data, 0) if data is not None else ""
def create_article_path(article: str, WIKI_ARTICLE_PATH: str) -> str: