Fix undefined error if allCards variable is null
All checks were successful
Test / build (push) Successful in 26s

This commit is contained in:
Ethan Lane 2025-01-03 14:41:08 +00:00
parent ff2980f3c0
commit 0092d91ee6

View file

@ -97,6 +97,8 @@ export default class CardDropHelperMetadata {
.filter(x => x.type == rarity)
.filter(x => !claimedCards.find(y => y.CardNumber == x.id));
if (!allCards) return undefined;
const randomCardIndex = Math.floor(Math.random() * allCards.length);
const card = allCards[randomCardIndex];