summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMischa Untaga <99098079+MischaU8@users.noreply.github.com>2023-11-06 19:13:47 +0100
committerMischa Untaga <99098079+MischaU8@users.noreply.github.com>2023-11-06 19:13:47 +0100
commit3f162130f66aa684bea6c1d708c4a89b0534a613 (patch)
treeed78934dfe2cda2c7cd07536d259c47fbd6cbb58
parentce732ca77bc0cbef6c053ec6095e81f2c624a327 (diff)
downloadvotes-for-women-3f162130f66aa684bea6c1d708c4a89b0534a613.tar.gz
skip null value
-rw-r--r--rules.js4
1 files 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
}