aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar xithrius <[email protected]>2021-02-12 00:49:27 -0800
committerGravatar xithrius <[email protected]>2021-02-12 00:49:27 -0800
commit889de9b678a044331f02eef647c7d1c963f37edd (patch)
treed1ff0451debc9db403674fb40698d2f028cdaae6
parentAccounting for completely empty fields that only contain whitespaces. (diff)
Finalized logic to account for null cases.
-rw-r--r--bot/exts/info/pypi.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/bot/exts/info/pypi.py b/bot/exts/info/pypi.py
index 990a5c905..4ad72b673 100644
--- a/bot/exts/info/pypi.py
+++ b/bot/exts/info/pypi.py
@@ -37,11 +37,11 @@ class PyPi(Cog):
embed.description = f"[{info['name']} v{info['version']}]({info['package_url']})\n"
for field in FIELDS:
- # Field could be completely empty, in some cases can be a string with whitespaces.
- if field_value := info[field].strip():
+ # Field could be completely empty, in some cases can be a string with whitespaces, or None.
+ if info[field] and not info[field].isspace():
embed.add_field(
name=field.replace("_", " ").title(),
- value=field_value,
+ value=info[field],
inline=False,
)