Fix issue #51 - edit countries with no capital

Check if a country has a capital before applying style so it doesn't
break.
This commit is contained in:
Evyatar Amitay 2018-05-07 10:18:35 +01:00
parent 11099bdd47
commit 852fd12e86

View file

@ -4523,6 +4523,7 @@ function fantasyMap() {
// highlight capital cells as it's not allowed to change capital's state that way
states.map(function(s) {
if (s.color === "neutral") {return;}
if (s.capital === "select" || !(s.capital in manors)) {return;}
const capital = s.capital;
const index = manors[capital].cell;
temp.append("path")