fix crash when showing uninitialized zone

This commit is contained in:
Peter F. Patel-Schneider
2019-02-19 08:10:09 -05:00
parent 2b0fc5a00a
commit 6fcb996938

View File

@@ -123,11 +123,16 @@ public class FloatingZone extends FloatingCardArea {
}; };
protected Iterable<CardView> getCards() { protected Iterable<CardView> getCards() {
cardList = new FCollection<CardView>(player.getCards(zone)); Iterable<CardView> zoneCards = player.getCards(zone);
if ( sortedByName ) { if ( zoneCards != null ) {
Collections.sort(cardList, comp); cardList = new FCollection<CardView>(player.getCards(zone));
} if ( sortedByName ) {
return cardList; Collections.sort(cardList, comp);
}
return cardList;
} else {
return null;
}
} }
private FloatingZone(final CMatchUI matchUI, final PlayerView player0, final ZoneType zone0) { private FloatingZone(final CMatchUI matchUI, final PlayerView player0, final ZoneType zone0) {