fix(aurora): cast to string before checking length to avoid typeerrors when reason is None

This commit is contained in:
Seaswimmer 2024-05-24 04:26:58 -04:00
parent 5b64ee9578
commit 73c9104882
Signed by untrusted user: cswimr
GPG key ID: 5D671B5D03D65A7F

View file

@ -1185,7 +1185,7 @@ class Aurora(commands.Cog):
field_name = f"Case #{mod.id:,} ({str.title(mod.type)})"
field_value = f"**Target:** `{target.name}` ({target.id})\n**Moderator:** `{moderator.name}` ({moderator.id})"
if len(mod.reason) > 125:
if len(str(mod.reason)) > 125:
field_value += f"\n**Reason:** `{str(mod.reason)[:125]}...`"
else:
field_value += f"\n**Reason:** `{str(mod.reason)}`"