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 = {}
for i = 1, #handCards do
local metadata = JSON.decode(handCards[i].getGMNotes()) or {}
if metadata.weakness == true or metadata.hidden == true then
else
local metadata = JSON.decode(handCards[i].getGMNotes())
if metadata ~= nil and (not metadata.weakness and not metadata.hidden) then
table.insert(cardsToDiscard, handCards[i])
end
end