This commit is contained in:
Jeff Wadsworth 2021-10-19 08:58:39 -05:00
parent fa79c1eba5
commit 25cb6e334d

View file

@ -64,9 +64,12 @@ class TreetopBracersRestrictEffect extends RestrictionEffect {
@Override
public boolean applies(Permanent permanent, Ability source, Game game) {
Permanent equipment = game.getPermanent(source.getSourceId());
if (equipment != null && equipment.getAttachedTo() != null) {
if (equipment != null
&& equipment.getAttachedTo() != null) {
Permanent equipped = game.getPermanent(equipment.getAttachedTo());
return permanent != null && permanent.getId().equals(equipped.getId());
return equipped != null
&& permanent != null
&& permanent.getId().equals(equipped.getId());
}
return false;
}