Fixed a bug where profile comment can be None

This commit is contained in:
Frisk 2020-07-28 13:41:33 +02:00
parent 7470612284
commit 7367973ea7
No known key found for this signature in database
GPG key ID: 213F7C15068AF8AC

View file

@ -97,6 +97,8 @@ class Wiki:
"{wiki}?action=comment&do=getRaw&comment_id={comment}&format=json".format(wiki=WIKI_API_PATH, "{wiki}?action=comment&do=getRaw&comment_id={comment}&format=json".format(wiki=WIKI_API_PATH,
comment=comment_id), "text") comment=comment_id), "text")
logger.debug("Got the following comment from the API: {}".format(comment)) logger.debug("Got the following comment from the API: {}".format(comment))
if comment is None:
raise TypeError
except (TypeError, AttributeError): except (TypeError, AttributeError):
logger.exception("Could not resolve the comment text.") logger.exception("Could not resolve the comment text.")
except KeyError: except KeyError: