Skip to content

Commit

Permalink
Merge pull request #5252 from Scoppio/fix-npe-missing-person-skill
Browse files Browse the repository at this point in the history
fix: adds null check before accessing skill property
  • Loading branch information
HammerGS authored Nov 29, 2024
2 parents 8c19ce2 + 318ec88 commit 0f0c41b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion MekHQ/src/mekhq/gui/adapter/PersonnelTableMouseAdapter.java
Original file line number Diff line number Diff line change
Expand Up @@ -2169,7 +2169,8 @@ protected Optional<JPopupMenu> createPopupMenu() {
if (specialistMenu.getMenuComponentCount() > 0) {
abMenu.add(specialistMenu);
}
} else if ((person.getOptions().getOption(spa.getName()).getType() == IOption.CHOICE)
} else if (Optional.ofNullable((person.getOptions().getOption(spa.getName()))).isPresent()
&& (person.getOptions().getOption(spa.getName()).getType() == IOption.CHOICE)
&& !(person.getOptions().getOption(spa.getName()).booleanValue())) {
JMenu specialistMenu = new JMenu(spa.getDisplayName());
List<String> choices = spa.getChoiceValues();
Expand Down

0 comments on commit 0f0c41b

Please sign in to comment.