- Only run the layout code from removeCardPanel if the panel has no attached panels (fixes NPE).

This commit is contained in:
Agetian
2017-01-10 17:30:47 +00:00
parent c1a1d7a210
commit 1eab1f0425
2 changed files with 3 additions and 4 deletions

View File

@@ -295,7 +295,9 @@ public abstract class CardPanelContainer extends SkinnedPanel {
fromPanel.dispose();
getCardPanels().remove(fromPanel);
remove(fromPanel);
this.doLayout();
if (fromPanel.getAttachedPanels() != null) {
this.doLayout();
}
invalidate();
repaint();
}

View File

@@ -892,9 +892,6 @@ public class PlayArea extends CardPanelContainer implements CardPanelMouseListen
}
private void addAttachedPanels(final CardPanel panel) {
if (panel == null) {
return;
}
for (final CardPanel attachedPanel : panel.getAttachedPanels()) {
if (panel.getCard() != null && super.add(attachedPanel)) {
addAttachedPanels(attachedPanel);