fixed few errors like NPE

This commit is contained in:
Oleg Agafonov 2023-12-15 16:51:12 +04:00
parent d03ebad794
commit 595b0e0070
3 changed files with 10 additions and 9 deletions

View file

@ -32,6 +32,9 @@ public class AttachedToMatchesFilterCondition implements Condition {
if (attachedTo == null) {
attachedTo = (Permanent) game.getLastKnownInformation(permanent.getAttachedTo(), Zone.BATTLEFIELD);
}
if (attachedTo == null) {
return false;
}
if (filter.match(attachedTo, attachedTo.getControllerId(), source, game)) {
return true;
}