mirror of
https://github.com/correl/mage.git
synced 2024-12-25 03:00:15 +00:00
Fixed possible NPE.
list.size() == 0 replaced with isEmpty()
This commit is contained in:
parent
8e788f3b32
commit
38a52daaec
2 changed files with 6 additions and 3 deletions
|
@ -1,7 +1,6 @@
|
||||||
package org.mage.plugins.card;
|
package org.mage.plugins.card;
|
||||||
|
|
||||||
import mage.cards.Card;
|
import mage.cards.Card;
|
||||||
import mage.cards.CardDimensions;
|
|
||||||
import mage.cards.MagePermanent;
|
import mage.cards.MagePermanent;
|
||||||
import mage.cards.action.ActionCallback;
|
import mage.cards.action.ActionCallback;
|
||||||
import mage.interfaces.plugin.CardPlugin;
|
import mage.interfaces.plugin.CardPlugin;
|
||||||
|
@ -74,6 +73,7 @@ public class CardPluginImpl implements CardPlugin {
|
||||||
log.info(plugin.toString() + " has been loaded.");
|
log.info(plugin.toString() + " has been loaded.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "[Card plugin, version 0.5]";
|
return "[Card plugin, version 0.5]";
|
||||||
}
|
}
|
||||||
|
@ -250,7 +250,7 @@ public class CardPluginImpl implements CardPlugin {
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean empty(List<?> list) {
|
private boolean empty(List<?> list) {
|
||||||
return list == null || list.size() == 0;
|
return list == null || list.isEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
private int wrap(Row sourceRow, List<Row> rows, int insertIndex) {
|
private int wrap(Row sourceRow, List<Row> rows, int insertIndex) {
|
||||||
|
@ -348,6 +348,7 @@ public class CardPluginImpl implements CardPlugin {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean addAll(Collection<? extends Stack> c) {
|
public boolean addAll(Collection<? extends Stack> c) {
|
||||||
boolean changed = super.addAll(c);
|
boolean changed = super.addAll(c);
|
||||||
c.clear();
|
c.clear();
|
||||||
|
@ -378,6 +379,7 @@ public class CardPluginImpl implements CardPlugin {
|
||||||
super(8);
|
super(8);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean add(MagePermanent panel) {
|
public boolean add(MagePermanent panel) {
|
||||||
boolean appended = super.add(panel);
|
boolean appended = super.add(panel);
|
||||||
//for (CardPanel attachedPanel : panel.attachedPanels)
|
//for (CardPanel attachedPanel : panel.attachedPanels)
|
||||||
|
@ -466,6 +468,7 @@ public class CardPluginImpl implements CardPlugin {
|
||||||
return new CardInfoPaneImpl();
|
return new CardInfoPaneImpl();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public BufferedImage getOriginalImage(CardView card) {
|
public BufferedImage getOriginalImage(CardView card) {
|
||||||
return ImageCache.getImageOriginal(card);
|
return ImageCache.getImageOriginal(card);
|
||||||
}
|
}
|
||||||
|
|
|
@ -101,7 +101,7 @@ class OpponentsPoisonCountersCount implements DynamicValue {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public DynamicValue clone() {
|
public DynamicValue clone() {
|
||||||
return instance;
|
return getInstance();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in a new issue