Skip to content

Commit

Permalink
Merge pull request #6468 from Scoppio/fix/npe-clicking-on-board-no-un…
Browse files Browse the repository at this point in the history
…it-selected

Fix/npe clicking on board no unit selected
  • Loading branch information
Sleet01 authored Jan 31, 2025
2 parents 91a6871 + 6805c5a commit 48c3552
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion megamek/src/megamek/client/ui/swing/MovementDisplay.java
Original file line number Diff line number Diff line change
Expand Up @@ -4668,6 +4668,10 @@ private void computeCFWarningHexes(Entity ce) {
@Override
public synchronized void actionPerformed(ActionEvent ev) {
final Entity ce = ce();
final String actionCmd = ev.getActionCommand();
if (actionCmd.equals(MoveCommand.MOVE_NEXT.getCmd())) {
selectEntity(clientgui.getClient().getNextEntityNum(currentEntity));
}

if (ce == null) {
return;
Expand All @@ -4681,7 +4685,6 @@ public synchronized void actionPerformed(ActionEvent ev) {
// odd...
return;
}
final String actionCmd = ev.getActionCommand();
final IGameOptions opts = clientgui.getClient().getGame().getOptions();
if (actionCmd.equals(MoveCommand.MOVE_NEXT.getCmd())) {
selectEntity(clientgui.getClient().getNextEntityNum(currentEntity));
Expand Down

0 comments on commit 48c3552

Please sign in to comment.