Skip to content

Commit

Permalink
Fixed undefined random weighted option (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
inmarelibero authored Sep 14, 2022
1 parent 8179ccf commit 96b4619
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const createUniqueTraitsCombination = () => {
// Randomly select a trait option
const option = getRandomWeightedOption(filteredOptions);
// Push selected trait option (if it has a defined value)
if (option.value) {
if (option !== undefined && option.value) {
traits.push({
...(type && { type }),
...(display && { display }),
Expand Down

0 comments on commit 96b4619

Please sign in to comment.