mirror of
https://github.com/correl/mage.git
synced 2024-12-24 11:50:45 +00:00
* Fixed possible NPE and added warning to log to check what abilities have no sourceId (fixes #1261).
This commit is contained in:
parent
b29fe86aa0
commit
7639f1bc6d
1 changed files with 10 additions and 6 deletions
|
@ -1225,13 +1225,17 @@ public class ContinuousEffects implements Serializable {
|
|||
for (ReplacementEffect effect : replacementEffects) {
|
||||
HashSet<Ability> abilities = replacementEffects.getAbility(effect.getId());
|
||||
for (Ability ability : abilities) {
|
||||
if (ability.getSourceId().equals(sourceId)) {
|
||||
if (controllerFound == null || controllerFound == ability.getControllerId()) {
|
||||
controllerFound = ability.getControllerId();
|
||||
} else {
|
||||
// not unique controller - No solution yet
|
||||
return null;
|
||||
if (ability.getSourceId() != null) {
|
||||
if (ability.getSourceId().equals(sourceId)) {
|
||||
if (controllerFound == null || controllerFound == ability.getControllerId()) {
|
||||
controllerFound = ability.getControllerId();
|
||||
} else {
|
||||
// not unique controller - No solution yet
|
||||
return null;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
logger.warn("Ability without sourceId:" + ability.getRule());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue