mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 12:18:00 +00:00
- NPE prevention in LobbyScreen on mobile Forge when trying to choose a variant without having a constructed deck.
This commit is contained in:
@@ -556,25 +556,27 @@ public abstract class LobbyScreen extends LaunchScreen implements ILobbyView {
|
||||
}
|
||||
|
||||
Deck playerDeck = deck;
|
||||
if (hasVariant(GameType.Archenemy) || hasVariant(GameType.ArchenemyRumble)) {
|
||||
if (playerDeck == deck) {
|
||||
playerDeck = new Deck(deck); //create copy that can be modified
|
||||
if (deck != null) {
|
||||
if (hasVariant(GameType.Archenemy) || hasVariant(GameType.ArchenemyRumble)) {
|
||||
if (playerDeck == deck) {
|
||||
playerDeck = new Deck(deck); //create copy that can be modified
|
||||
}
|
||||
playerDeck.putSection(DeckSection.Schemes, playerPanel.getSchemeDeck().get(DeckSection.Schemes));
|
||||
}
|
||||
playerDeck.putSection(DeckSection.Schemes, playerPanel.getSchemeDeck().get(DeckSection.Schemes));
|
||||
}
|
||||
if (hasVariant(GameType.Planechase)) {
|
||||
if (playerDeck == deck) {
|
||||
playerDeck = new Deck(deck); //create copy that can be modified
|
||||
if (hasVariant(GameType.Planechase)) {
|
||||
if (playerDeck == deck) {
|
||||
playerDeck = new Deck(deck); //create copy that can be modified
|
||||
}
|
||||
playerDeck.putSection(DeckSection.Planes, playerPanel.getPlanarDeck().get(DeckSection.Planes));
|
||||
}
|
||||
playerDeck.putSection(DeckSection.Planes, playerPanel.getPlanarDeck().get(DeckSection.Planes));
|
||||
}
|
||||
if (hasVariant(GameType.Vanguard)) {
|
||||
if (playerDeck == deck) {
|
||||
playerDeck = new Deck(deck); //create copy that can be modified
|
||||
if (hasVariant(GameType.Vanguard)) {
|
||||
if (playerDeck == deck) {
|
||||
playerDeck = new Deck(deck); //create copy that can be modified
|
||||
}
|
||||
CardPool avatarPool = new CardPool();
|
||||
avatarPool.add(playerPanel.getVanguardAvatar());
|
||||
playerDeck.putSection(DeckSection.Avatar, avatarPool);
|
||||
}
|
||||
CardPool avatarPool = new CardPool();
|
||||
avatarPool.add(playerPanel.getVanguardAvatar());
|
||||
playerDeck.putSection(DeckSection.Avatar, avatarPool);
|
||||
}
|
||||
|
||||
decks[playerIndex] = playerDeck;
|
||||
|
||||
Reference in New Issue
Block a user