handles no metadata
This commit is contained in:
parent
c31850fd93
commit
ec3a00b6ff
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user