Throwing exception if triggerdAbility == null.

This commit is contained in:
LevelX2 2013-05-20 10:51:45 +02:00
parent 199673622b
commit 8dd1a0fad0

View file

@ -751,7 +751,7 @@ public abstract class PlayerImpl<T extends PlayerImpl<T>> implements Player, Ser
public boolean triggerAbility(TriggeredAbility source, Game game) { public boolean triggerAbility(TriggeredAbility source, Game game) {
if (source == null) { if (source == null) {
log.warn("Null source in triggerAbility method"); log.warn("Null source in triggerAbility method");
return false; throw new IllegalArgumentException("source TriggeredAbility must not be null");
} }
//20091005 - 603.3c, 603.3d //20091005 - 603.3c, 603.3d
int bookmark = game.bookmarkState(); int bookmark = game.bookmarkState();
@ -1065,6 +1065,7 @@ public abstract class PlayerImpl<T extends PlayerImpl<T>> implements Player, Ser
} }
@SuppressWarnings({"null", "ConstantConditions"})
private int doDamage(int damage, UUID sourceId, Game game, boolean combatDamage, boolean preventable, ArrayList<UUID> appliedEffects) { private int doDamage(int damage, UUID sourceId, Game game, boolean combatDamage, boolean preventable, ArrayList<UUID> appliedEffects) {
if (damage > 0 && canDamage(game.getObject(sourceId), game)) { if (damage > 0 && canDamage(game.getObject(sourceId), game)) {
GameEvent event = new DamagePlayerEvent(playerId, sourceId, playerId, damage, preventable, combatDamage); GameEvent event = new DamagePlayerEvent(playerId, sourceId, playerId, damage, preventable, combatDamage);