Skip to content

Commit

Permalink
Check for null can_build_improvement in city object.
Browse files Browse the repository at this point in the history
  • Loading branch information
andreasrosdal committed Jul 23, 2015
1 parent eeb7c6a commit b830ee0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion freeciv-web/src/main/webapp/javascript/city.js
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}


Expand Down

0 comments on commit b830ee0

Please sign in to comment.