mirror of
https://github.com/correl/mage.git
synced 2024-12-25 19:25:41 +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,6 +1225,7 @@ 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() != null) {
|
||||||
if (ability.getSourceId().equals(sourceId)) {
|
if (ability.getSourceId().equals(sourceId)) {
|
||||||
if (controllerFound == null || controllerFound == ability.getControllerId()) {
|
if (controllerFound == null || controllerFound == ability.getControllerId()) {
|
||||||
controllerFound = ability.getControllerId();
|
controllerFound = ability.getControllerId();
|
||||||
|
@ -1233,6 +1234,9 @@ public class ContinuousEffects implements Serializable {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
logger.warn("Ability without sourceId:" + ability.getRule());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return controllerFound;
|
return controllerFound;
|
||||||
|
|
Loading…
Reference in a new issue