diff options
| author | 2021-02-12 00:49:27 -0800 | |
|---|---|---|
| committer | 2021-02-12 00:49:27 -0800 | |
| commit | 889de9b678a044331f02eef647c7d1c963f37edd (patch) | |
| tree | d1ff0451debc9db403674fb40698d2f028cdaae6 | |
| parent | Accounting for completely empty fields that only contain whitespaces. (diff) | |
Finalized logic to account for null cases.
| -rw-r--r-- | bot/exts/info/pypi.py | 6 |
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, ) |