From 83c1452683fc6dbc1d6fff559dc4b9c98802e375 Mon Sep 17 00:00:00 2001 From: asvitkine Date: Sun, 29 May 2022 19:59:41 -0400 Subject: [PATCH] Fix getPlayers() in TriggerAttachment. (#10526) * Fix getPlayers() in TriggerAttachment. * Remove import. --- .../strategy/triplea/attachments/TriggerAttachment.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/game-app/game-core/src/main/java/games/strategy/triplea/attachments/TriggerAttachment.java b/game-app/game-core/src/main/java/games/strategy/triplea/attachments/TriggerAttachment.java index 2293e32af3..42facf5c0f 100644 --- a/game-app/game-core/src/main/java/games/strategy/triplea/attachments/TriggerAttachment.java +++ b/game-app/game-core/src/main/java/games/strategy/triplea/attachments/TriggerAttachment.java @@ -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; @@ -842,9 +841,8 @@ private void setPlayers(final List value) { } private List getPlayers() { - return players == null - ? List.of((GamePlayer) getAttachedTo()) - : Collections.unmodifiableList(players); + List result = getListProperty(players); + return result.isEmpty() ? List.of((GamePlayer) getAttachedTo()) : result; } private void resetPlayers() {