MagicCardDefinition.add throws RuntimeException ifi null is passed

master
melvin 2011-11-11 10:56:00 +08:00
parent f07176f36e
commit 4de9d4616b
1 changed files with 3 additions and 1 deletions

View File

@ -256,7 +256,9 @@ public class MagicCardDefinition {
} }
public void add(final Object obj) { public void add(final Object obj) {
if (obj instanceof MagicSpellCardEvent) { if (obj == null) {
throw new RuntimeException("MagicCardDefinition.add passed null");
} else if (obj instanceof MagicSpellCardEvent) {
final MagicSpellCardEvent cevent = (MagicSpellCardEvent)obj; final MagicSpellCardEvent cevent = (MagicSpellCardEvent)obj;
setCardEvent(cevent); setCardEvent(cevent);
cevent.setCardIndex(index); cevent.setCardIndex(index);