mirror of
https://github.com/correl/mage.git
synced 2024-12-25 11:11:16 +00:00
Fixed possible NPE problems.
This commit is contained in:
parent
371ee4014c
commit
74edb0f0ef
2 changed files with 2 additions and 2 deletions
|
@ -60,7 +60,7 @@ public class PayLoyaltyCost extends CostImpl {
|
|||
@Override
|
||||
public boolean canPay(Ability ability, UUID sourceId, UUID controllerId, Game game) {
|
||||
Permanent planeswalker = game.getPermanent(sourceId);
|
||||
return planeswalker.getCounters().getCount(CounterType.LOYALTY) + amount >= 0 && planeswalker.canLoyaltyBeUsed(game);
|
||||
return planeswalker != null && planeswalker.getCounters().getCount(CounterType.LOYALTY) + amount >= 0 && planeswalker.canLoyaltyBeUsed(game);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -63,7 +63,7 @@ public class RemoveCountersSourceCost extends CostImpl {
|
|||
@Override
|
||||
public boolean canPay(Ability ability, UUID sourceId, UUID controllerId, Game game) {
|
||||
Permanent permanent = game.getPermanent(sourceId);
|
||||
if (permanent.getCounters().getCount(name) >= amount) {
|
||||
if (permanent != null && permanent.getCounters().getCount(name) >= amount) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
Loading…
Reference in a new issue