mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 03:08:02 +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();
|
fromPanel.dispose();
|
||||||
getCardPanels().remove(fromPanel);
|
getCardPanels().remove(fromPanel);
|
||||||
remove(fromPanel);
|
remove(fromPanel);
|
||||||
this.doLayout();
|
if (fromPanel.getAttachedPanels() != null) {
|
||||||
|
this.doLayout();
|
||||||
|
}
|
||||||
invalidate();
|
invalidate();
|
||||||
repaint();
|
repaint();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -892,9 +892,6 @@ public class PlayArea extends CardPanelContainer implements CardPanelMouseListen
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void addAttachedPanels(final CardPanel panel) {
|
private void addAttachedPanels(final CardPanel panel) {
|
||||||
if (panel == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
for (final CardPanel attachedPanel : panel.getAttachedPanels()) {
|
for (final CardPanel attachedPanel : panel.getAttachedPanels()) {
|
||||||
if (panel.getCard() != null && super.add(attachedPanel)) {
|
if (panel.getCard() != null && super.add(attachedPanel)) {
|
||||||
addAttachedPanels(attachedPanel);
|
addAttachedPanels(attachedPanel);
|
||||||
|
|||||||
Reference in New Issue
Block a user