From d2b498a3ba8a012f2b52cb8d4e8f12d0b8350828 Mon Sep 17 00:00:00 2001 From: Buhallin Date: Thu, 17 Nov 2022 18:51:31 -0800 Subject: [PATCH] Fix bug with deck loader since trait removal Since traits are now an optional field in the metadata, add nil checks when using them --- src/arkhamdb/DeckImporterMain.ttslua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/arkhamdb/DeckImporterMain.ttslua b/src/arkhamdb/DeckImporterMain.ttslua index 4700b9fa..738f131b 100644 --- a/src/arkhamdb/DeckImporterMain.ttslua +++ b/src/arkhamdb/DeckImporterMain.ttslua @@ -540,7 +540,7 @@ function handleUnderworldMarket(cardList, playerColor) -- Underworld Market found hasMarket = true card.zone = "SetAside3" - elseif (string.find(card.metadata.traits, "Illicit", 1, true) + elseif (card.metadata.traits ~= nil and string.find(card.metadata.traits, "Illicit", 1, true) and card.metadata.bonded_to == nil and not card.metadata.weakness) then table.insert(illicitList, i) @@ -583,6 +583,7 @@ function handleHunchDeck(investigatorId, cardList, playerColor) local insightList = {} for i, card in ipairs(cardList) do if (card.metadata.type == "Event" + and card.metadata.traits ~= nil and string.match(card.metadata.traits, "Insight") and card.metadata.bonded_to == nil) then table.insert(insightList, i)