Skip to content

Commit

Permalink
Fix bug in helpdata dialog where some tech requirements could be null.
Browse files Browse the repository at this point in the history
  • Loading branch information
andreasrosdal committed Mar 16, 2015
1 parent 496e108 commit 2bfb4af
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions freeciv-web/src/main/webapp/javascript/helpdata.js
Original file line number Diff line number Diff line change
Expand Up @@ -216,11 +216,11 @@ function generate_help_text(key)
msg += "<br>Vision: " + punit_type['vision_radius_sq'];

var ireq = get_improvement_requirements(punit_type['impr_requirement']);
if (ireq != null) {
if (ireq != null && techs[ireq] != null) {
msg += "<br>Building Requirements: " + techs[ireq]['name'];
}
var treq = punit_type['tech_requirement'];
if (treq != null) {
if (treq != null && techs[treq] != null) {
msg += "<br>Tech Requirements: " + techs[treq]['name'];
}
msg += "<br><br><button class='help_button' onclick=\"show_wikipedia_dialog('" + punit_type['name'] + "');\">Wikipedia on "
Expand Down

0 comments on commit 2bfb4af

Please sign in to comment.