Skip to content

Commit

Permalink
Fix getPlayers() in TriggerAttachment. (#10526)
Browse files Browse the repository at this point in the history
* Fix getPlayers() in TriggerAttachment.

* Remove import.
  • Loading branch information
asvitkine committed May 29, 2022
1 parent c596ae3 commit 83c1452
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
import games.strategy.triplea.ui.NotificationMessages;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedHashMap;
Expand Down Expand Up @@ -842,9 +841,8 @@ private void setPlayers(final List<GamePlayer> value) {
}

private List<GamePlayer> getPlayers() {
return players == null
? List.of((GamePlayer) getAttachedTo())
: Collections.unmodifiableList(players);
List<GamePlayer> result = getListProperty(players);
return result.isEmpty() ? List.of((GamePlayer) getAttachedTo()) : result;
}

private void resetPlayers() {
Expand Down

0 comments on commit 83c1452

Please sign in to comment.