mirror of
https://github.com/magefree/mage.git
synced 2026-01-26 13:19:18 -08:00
Fixed NPE which happened on occasion during AI simulations.
This commit is contained in:
parent
7698581116
commit
ff3e0108cd
1 changed files with 12 additions and 8 deletions
|
|
@ -94,17 +94,21 @@ class VampireHexmageEffect extends OneShotEffect<VampireHexmageEffect> {
|
||||||
|
|
||||||
Permanent permanent = game.getPermanent(target.getFirstTarget());
|
Permanent permanent = game.getPermanent(target.getFirstTarget());
|
||||||
|
|
||||||
String[ ] counterNames = permanent.getCounters().keySet().toArray(new String[0]);
|
if ( permanent != null ) {
|
||||||
|
String[ ] counterNames = permanent.getCounters().keySet().toArray(new String[0]);
|
||||||
|
|
||||||
if ( permanent.getLoyalty() != null ) {
|
if ( permanent.getLoyalty() != null ) {
|
||||||
permanent.getLoyalty().setValue(0);
|
permanent.getLoyalty().setValue(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
for ( String counterName : counterNames ) {
|
for ( String counterName : counterNames ) {
|
||||||
permanent.getCounters().remove(counterName);
|
permanent.getCounters().remove(counterName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue