From 3369a06c4e135879ff0899b2349f16c26b19fca2 Mon Sep 17 00:00:00 2001 From: Ske Date: Mon, 28 Oct 2019 16:50:41 +0100 Subject: [PATCH] Fix message querying on accounts with no roles --- PluralKit.Bot/Services/EmbedService.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/PluralKit.Bot/Services/EmbedService.cs b/PluralKit.Bot/Services/EmbedService.cs index a0136918..95489ab2 100644 --- a/PluralKit.Bot/Services/EmbedService.cs +++ b/PluralKit.Bot/Services/EmbedService.cs @@ -184,7 +184,8 @@ namespace PluralKit.Bot { .AddField("Sent by", userStr, inline: true) .WithTimestamp(SnowflakeUtils.FromSnowflake(msg.Message.Mid)); - if (roles != null) eb.AddField($"Account roles ({roles.Count})", string.Join(", ", roles.Select(role => role.Name))); + if (roles != null && roles.Count > 0) + eb.AddField($"Account roles ({roles.Count})", string.Join(", ", roles.Select(role => role.Name))); return eb.Build(); }