mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-16 10:48:00 +00:00
- Only run the layout code from removeCardPanel if the panel has no attached panels (fixes NPE).
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user