From ff15e21b5af76878ae5da79d426b326d65b9bd9e Mon Sep 17 00:00:00 2001 From: Runebaas Date: Sat, 2 Mar 2019 00:32:59 -0500 Subject: [PATCH] Upgrade Gatherer Client and fix bug where card legalities could be an empty collection and throwing and exception as a result --- Geekbot.net/Commands/Integrations/MagicTheGathering.cs | 2 +- Geekbot.net/Geekbot.net.csproj | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Geekbot.net/Commands/Integrations/MagicTheGathering.cs b/Geekbot.net/Commands/Integrations/MagicTheGathering.cs index 2d3e7c6..bb95eb7 100644 --- a/Geekbot.net/Commands/Integrations/MagicTheGathering.cs +++ b/Geekbot.net/Commands/Integrations/MagicTheGathering.cs @@ -57,7 +57,7 @@ namespace Geekbot.net.Commands.Integrations if (!string.IsNullOrEmpty(card.ManaCost)) eb.AddInlineField("Cost", _manaConverter.ConvertMana(card.ManaCost)); if (!string.IsNullOrEmpty(card.Rarity)) eb.AddInlineField("Rarity", card.Rarity); - if (card.Legalities != null) + if (card.Legalities != null && card.Legalities.Count > 0) eb.AddField("Legality", string.Join(", ", card.Legalities.Select(e => e.Format))); await ReplyAsync("", false, eb.Build()); diff --git a/Geekbot.net/Geekbot.net.csproj b/Geekbot.net/Geekbot.net.csproj index 554950c..b0a92d9 100755 --- a/Geekbot.net/Geekbot.net.csproj +++ b/Geekbot.net/Geekbot.net.csproj @@ -40,7 +40,7 @@ - +