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:
Evan Kranzler 2021-06-13 10:13:41 -04:00
parent b5223a4279
commit d202278ccd

View file

@ -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