From 3f162130f66aa684bea6c1d708c4a89b0534a613 Mon Sep 17 00:00:00 2001 From: Mischa Untaga <99098079+MischaU8@users.noreply.github.com> Date: Mon, 6 Nov 2023 19:13:47 +0100 Subject: skip null value --- rules.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rules.js b/rules.js index 976a21d..4a8a4bc 100644 --- a/rules.js +++ b/rules.js @@ -111,7 +111,7 @@ function is_player_claimed_card(c) { // #region US_STATES & REGIONS FUNCTIONS function find_us_state(name) { - return US_STATES.findIndex((x) => x.name === name) + return US_STATES.findIndex((x) => x && x.name === name) } function us_states(...args) { @@ -121,7 +121,7 @@ function us_states(...args) { function region_us_states(region) { const indexes = [] US_STATES.forEach((element, index) => { - if (element.region === region) indexes.push(index) + if (element && element.region === region) indexes.push(index) }) return indexes } -- cgit v1.2.3