forked from External/mage
Added test and fixed some possible null pointer exception.
This commit is contained in:
parent
13c8f3263f
commit
bf43ea9936
10 changed files with 130 additions and 31 deletions
|
|
@ -1499,6 +1499,17 @@ public abstract class GameImpl implements Game, Serializable {
|
|||
|
||||
@Override
|
||||
public void addTriggeredAbility(TriggeredAbility ability) {
|
||||
if (ability.getControllerId() == null) {
|
||||
String sourceName = "no sourceId";
|
||||
if (ability.getSourceId() != null) {
|
||||
MageObject mageObject = getObject(ability.getSourceId());
|
||||
if (mageObject != null) {
|
||||
sourceName = mageObject.getName();
|
||||
}
|
||||
}
|
||||
logger.fatal("Added triggered ability without controller: " + sourceName + " rule: " + ability.getRule());
|
||||
return;
|
||||
}
|
||||
if (ability instanceof TriggeredManaAbility || ability instanceof DelayedTriggeredManaAbility) {
|
||||
// 20110715 - 605.4
|
||||
Ability manaAbiltiy = ability.copy();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue