From c0718a1516f19c5d39979ed418f37adc7a173e31 Mon Sep 17 00:00:00 2001 From: Ske Date: Sat, 23 Mar 2019 17:42:18 +0100 Subject: [PATCH] Fix crash on member listing with member without description --- src/pluralkit/bot/embeds.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/pluralkit/bot/embeds.py b/src/pluralkit/bot/embeds.py index 18941480..a5a6797f 100644 --- a/src/pluralkit/bot/embeds.py +++ b/src/pluralkit/bot/embeds.py @@ -244,10 +244,11 @@ def member_list(system: System, all_members: List[Member], current_page: int, pa member_description += "**Birthday:** {}\n".format(member.birthday_string()) if member.pronouns: member_description += "**Pronouns:** {}\n".format(member.pronouns) - if len(member.description) > 512: - member_description += "\n" + truncate_description_list(member.description) + "\n" + "Type `pk;member {}` for full description.".format(member.hid) - else: - member_description += "\n" + member.description + if member.description: + if len(member.description) > 512: + member_description += "\n" + truncate_description_list(member.description) + "\n" + "Type `pk;member {}` for full description.".format(member.hid) + else: + member_description += "\n" + member.description embed.add_field(name=member.name, value=truncate_field_body(member_description) or "\u200B", inline=False) return embed