diff options
author | notoraptor <stevenbocco@gmail.com> | 2018-10-25 11:20:45 -0400 |
---|---|---|
committer | notoraptor <stevenbocco@gmail.com> | 2019-04-18 11:17:31 -0400 |
commit | bd854ba28d37d426a1822e97baf8dc8f8b44b993 (patch) | |
tree | 055b7206a024676f913c1d091c2bd0e66fb497bc /diplomacy/web/src/gui | |
parent | 73132ed777dc5961e18d2730f4f136e41d0a03a2 (diff) |
Web - Fixed issue when hovering over a province with no orders
- Checking if there are available orders for a province when hovering over it.
Diffstat (limited to 'diplomacy/web/src/gui')
-rw-r--r-- | diplomacy/web/src/gui/diplomacy/map/dom_past_map.js | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/diplomacy/web/src/gui/diplomacy/map/dom_past_map.js b/diplomacy/web/src/gui/diplomacy/map/dom_past_map.js index 58fd6c8..eb44616 100644 --- a/diplomacy/web/src/gui/diplomacy/map/dom_past_map.js +++ b/diplomacy/web/src/gui/diplomacy/map/dom_past_map.js @@ -41,10 +41,12 @@ export class DOMPastMap { const orders = []; if (this.orders) { for (let powerOrders of Object.values(this.orders)) { - for (let order of powerOrders) { - const pieces = order.split(/ +/); - if (pieces[1].slice(0, 3) === name.toUpperCase().slice(0, 3)) - orders.push(order); + if (powerOrders) { + for (let order of powerOrders) { + const pieces = order.split(/ +/); + if (pieces[1].slice(0, 3) === name.toUpperCase().slice(0, 3)) + orders.push(order); + } } } } |