mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 12:48:00 +00:00
fixing NPE on draft deck opened in editor
This commit is contained in:
@@ -70,6 +70,18 @@ public class DeckGroup extends DeckBase {
|
||||
public final void setHumanDeck(final Deck humanDeck) {
|
||||
this.humanDeck = humanDeck;
|
||||
}
|
||||
|
||||
protected void cloneFieldsTo(final DeckBase clone) {
|
||||
super.cloneFieldsTo(clone);
|
||||
|
||||
DeckGroup myClone = (DeckGroup) clone;
|
||||
myClone.setHumanDeck((Deck)this.getHumanDeck().copyTo(this.getHumanDeck().getName()));
|
||||
|
||||
for(int i = 0; i < this.getAiDecks().size(); i++) {
|
||||
Deck src = this.getAiDecks().get(i);
|
||||
myClone.addAiDeck((Deck)src.copyTo(src.getName()));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds the ai deck.
|
||||
|
||||
@@ -409,8 +409,9 @@ public final class DeckEditorLimited extends DeckEditorBase<CardPrinted, DeckGro
|
||||
*/
|
||||
@Override
|
||||
public void updateView() {
|
||||
this.getTopTableWithCards().setDeck(this.getSelectedDeck(this.controller.getModel()).getSideboard());
|
||||
this.getBottomTableWithCards().setDeck(this.getSelectedDeck(this.controller.getModel()).getMain());
|
||||
Deck toEdit = this.getSelectedDeck(this.controller.getModel());
|
||||
this.getTopTableWithCards().setDeck(toEdit.getSideboard());
|
||||
this.getBottomTableWithCards().setDeck(toEdit.getMain());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user