From 852fd12e86f9f2fbb985acd04b44fdcdabfb99f9 Mon Sep 17 00:00:00 2001 From: Evyatar Amitay Date: Mon, 7 May 2018 10:18:35 +0100 Subject: [PATCH] Fix issue #51 - edit countries with no capital Check if a country has a capital before applying style so it doesn't break. --- script.js | 1 + 1 file changed, 1 insertion(+) diff --git a/script.js b/script.js index a6031ba0..86c14da2 100644 --- a/script.js +++ b/script.js @@ -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")