From 0c4e33fd0c1030eb4e79f796a110221a829583b2 Mon Sep 17 00:00:00 2001 From: Chr1Z93 Date: Thu, 8 Aug 2024 21:39:25 +0200 Subject: [PATCH] error handling --- src/playercards/AllCardsBag.ttslua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/playercards/AllCardsBag.ttslua b/src/playercards/AllCardsBag.ttslua index e250e22f..5207a8e1 100644 --- a/src/playercards/AllCardsBag.ttslua +++ b/src/playercards/AllCardsBag.ttslua @@ -241,8 +241,8 @@ function buildSupplementalIndexes() writeToNestedTable(customInvestigatorData, "InvestigatorSubdata", cardId, "cards", cardId) -- read the signatures - if card.metadata.signatures then - for sigId, sigCount in pairs(card.metadata.signatures[1]) do + if card.metadata.signatures and type(card.metadata.signatures) == "table" then + for sigId, sigCount in pairs(card.metadata.signatures[1] or {}) do customSignatureDict[sigId] = true for i = 1, sigCount do writeToNestedTable(customInvestigatorData, "InvestigatorSubdata", cardId, "signatures", sigId)