aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Numerlor <[email protected]>2020-09-21 00:52:40 +0200
committerGravatar Numerlor <[email protected]>2020-09-21 00:52:40 +0200
commitb6ef6b6bc30b02e0a6797dd9feae167da2cb6e5b (patch)
treeb6c60aad551eb414d78ae9ceb9dc0ddb7e019950
parentUse f strings instead of c style on copied code (diff)
Handle cases with outdated bot inventories.
-rw-r--r--bot/cogs/doc/parsing.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/bot/cogs/doc/parsing.py b/bot/cogs/doc/parsing.py
index ed6343cd8..939f963f1 100644
--- a/bot/cogs/doc/parsing.py
+++ b/bot/cogs/doc/parsing.py
@@ -198,6 +198,9 @@ def get_symbol_markdown(soup: BeautifulSoup, symbol_data: DocItem) -> str:
The method of parsing and what information gets included depends on the symbol's group.
"""
symbol_heading = soup.find(id=symbol_data.symbol_id)
+ if symbol_heading is None:
+ log.warning("Symbol present in loaded inventories not found on site, consider refreshing inventories.")
+ return "Unable to parse the requested symbol."
signature = None
# Modules, doc pages and labels don't point to description list tags but to tags like divs,
# no special parsing can be done so we only try to include what's under them.