handles no metadata

This commit is contained in:
dscarpac 2024-06-25 16:09:51 -05:00
parent c31850fd93
commit ec3a00b6ff

View File

@ -378,9 +378,8 @@ function doUpkeep(_, clickedByColor, isRightClick)
local cardsToDiscard = {} local cardsToDiscard = {}
for i = 1, #handCards do for i = 1, #handCards do
local metadata = JSON.decode(handCards[i].getGMNotes()) or {} local metadata = JSON.decode(handCards[i].getGMNotes())
if metadata.weakness == true or metadata.hidden == true then if metadata ~= nil and (not metadata.weakness and not metadata.hidden) then
else
table.insert(cardsToDiscard, handCards[i]) table.insert(cardsToDiscard, handCards[i])
end end
end end