From 17015189f1c6ca35544fa59b1c2fe31caf932055 Mon Sep 17 00:00:00 2001 From: Guangcong Luo Date: Thu, 2 Nov 2017 14:35:07 -0500 Subject: [PATCH] Don't crash when validating impossible moves --- sim/team-validator.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sim/team-validator.js b/sim/team-validator.js index e1bdd10305..8f02a112cb 100644 --- a/sim/team-validator.js +++ b/sim/team-validator.js @@ -508,7 +508,7 @@ class Validator { } } - if (!lsetData.sourcesBefore && lsetData.sources.every(source => 'SVD'.includes(source.charAt(1)))) { + if (!lsetData.sourcesBefore && lsetData.sources.length && lsetData.sources.every(source => 'SVD'.includes(source.charAt(1)))) { // Every source is restricted let legal = false; for (const source of lsetData.sources) {