mirror of
https://github.com/correl/mage.git
synced 2024-12-24 11:50:45 +00:00
change to containsKey method to prevent stream exceptions (fixes #7904, fixes #7880, fixes #7844, fixes #7810, fixes #7805, fixes #7675, fixes #7669, fixes #7654, fixes #7651)
This commit is contained in:
parent
b5223a4279
commit
d202278ccd
1 changed files with 9 additions and 1 deletions
|
@ -261,7 +261,15 @@ public class AbilitiesImpl<T extends Ability> extends ArrayList<T> implements Ab
|
|||
|
||||
@Override
|
||||
public boolean containsKey(UUID abilityId) { // TODO: remove
|
||||
return stream().map(T::getId).anyMatch(abilityId::equals);
|
||||
if (abilityId == null) {
|
||||
return false;
|
||||
}
|
||||
for (T ability : this) {
|
||||
if (ability != null && abilityId.equals(ability.getId())) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in a new issue