From a260fd92b273e191aff7cde9574214afd2c5ef26 Mon Sep 17 00:00:00 2001 From: magenoxx Date: Wed, 3 Aug 2011 10:04:36 +0400 Subject: [PATCH] added swallowing the exception occurred time to time on battlefield permanent sort --- .../main/java/org/mage/plugins/card/CardPluginImpl.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Mage.Plugins/Mage.Card.Plugin/src/main/java/org/mage/plugins/card/CardPluginImpl.java b/Mage.Plugins/Mage.Card.Plugin/src/main/java/org/mage/plugins/card/CardPluginImpl.java index e1bc3d05dc..a78fbc18a0 100644 --- a/Mage.Plugins/Mage.Card.Plugin/src/main/java/org/mage/plugins/card/CardPluginImpl.java +++ b/Mage.Plugins/Mage.Card.Plugin/src/main/java/org/mage/plugins/card/CardPluginImpl.java @@ -256,7 +256,13 @@ public class CardPluginImpl implements CardPlugin { int panelX = x + (stackPosition * stackSpacingX); int panelY = y + (stackPosition * stackSpacingY); //panel.setLocation(panelX, panelY); - battlefieldPanel.moveToBack(panel); + try { + // may cause: + // java.lang.IllegalArgumentException: illegal component position 26 should be less then 26 + battlefieldPanel.moveToBack(panel); + } catch (Exception e) { + e.printStackTrace(); + } panel.setCardBounds(panelX, panelY, cardWidth, cardHeight); } rowBottom = Math.max(rowBottom, y + stack.getHeight());