Skip to content

Commit 0df6645

Browse files
authored
Card.selectable_from_pack null check (#997)
I'm not sure exactly what error I had gotten that this fixes (It may have been a voucher pack from the Betmma Mods suite?), but this does fix it. review comment: Actually I think this check is needed now for mod compat: probably selectable_from_pack was called by means other than smods opening a pack under smods' control
1 parent 9b64438 commit 0df6645

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/utils.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2310,12 +2310,12 @@ G.FUNCS.can_select_from_booster = function(e)
23102310

23112311
function Card.selectable_from_pack(card, pack)
23122312
if card.config.center.select_card then return card.config.center.select_card end
2313-
if pack.select_exclusions then
2313+
if pack and pack.select_exclusions then
23142314
for _, key in ipairs(pack.select_exclusions) do
23152315
if key == card.config.center_key then return false end
23162316
end
23172317
end
2318-
if pack.select_card then
2318+
if pack and pack.select_card then
23192319
if type(pack.select_card) == 'table' then
23202320
if pack.select_card[card.ability.set] then return pack.select_card[card.ability.set] else return false end
23212321
end

0 commit comments

Comments
 (0)