Skip to content

Commit

Permalink
Issue NineWorlds#64 Fix NPE when a ship has no upgrades
Browse files Browse the repository at this point in the history
When a ship has no upgrades the XWS file won't load because
there is a NPE error when looking to check Veteran Instincs
calculations.
  • Loading branch information
kingargyle committed Dec 19, 2017
1 parent 764a913 commit 87ababf
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ public void widgetSelected(SelectionEvent e) {
if (actualPilot != null) {
Integer skill = Integer.valueOf(actualPilot.getSkill());
com.github.xws.Upgrades upgrades = pilot.getUpgrades();
if (upgrades.findUpgrade("veteraninstincts") != null) {
if (upgrades != null && upgrades.findUpgrade("veteraninstincts") != null) {
skill = skill + 2;
}
pilot.setPilotSkill(Integer.toString(skill));
Expand Down

0 comments on commit 87ababf

Please sign in to comment.