mirror of
https://github.com/correl/mage.git
synced 2024-12-26 03:00:11 +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) {
|
for (ReplacementEffect effect : replacementEffects) {
|
||||||
HashSet<Ability> abilities = replacementEffects.getAbility(effect.getId());
|
HashSet<Ability> abilities = replacementEffects.getAbility(effect.getId());
|
||||||
for (Ability ability : abilities) {
|
for (Ability ability : abilities) {
|
||||||
if (ability.getSourceId().equals(sourceId)) {
|
if (ability.getSourceId() != null) {
|
||||||
if (controllerFound == null || controllerFound == ability.getControllerId()) {
|
if (ability.getSourceId().equals(sourceId)) {
|
||||||
controllerFound = ability.getControllerId();
|
if (controllerFound == null || controllerFound == ability.getControllerId()) {
|
||||||
} else {
|
controllerFound = ability.getControllerId();
|
||||||
// not unique controller - No solution yet
|
} else {
|
||||||
return null;
|
// not unique controller - No solution yet
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
logger.warn("Ability without sourceId:" + ability.getRule());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue