Skip to content

Commit

Permalink
fix: adds null check before accessing skill property
Browse files Browse the repository at this point in the history
  • Loading branch information
Scoppio committed Nov 26, 2024
1 parent 6975c49 commit 318ec88
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 318ec88

Please sign in to comment.