From b830ee0eab4a04d4d946882b87ca8f3fd73e2475 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20R=C3=B8sdal?= Date: Thu, 23 Jul 2015 22:20:01 +0200 Subject: [PATCH] Check for null can_build_improvement in city object. --- freeciv-web/src/main/webapp/javascript/city.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/freeciv-web/src/main/webapp/javascript/city.js b/freeciv-web/src/main/webapp/javascript/city.js index f5085e7f4..fca88abf7 100644 --- a/freeciv-web/src/main/webapp/javascript/city.js +++ b/freeciv-web/src/main/webapp/javascript/city.js @@ -502,7 +502,8 @@ function can_city_build_unit_now(pcity, punittype) **************************************************************************/ function can_city_build_improvement_now(pcity, pimprove) { - return (pcity['can_build_improvement'][pimprove['id']] == "1"); + return (pcity != null && pcity['can_build_improvement'] != null + && pcity['can_build_improvement'][pimprove['id']] == "1"); }