mirror of
https://github.com/correl/mage.git
synced 2024-12-26 03:00:11 +00:00
* ManaSpentToCastWatcher - Fixed possible null pointer exception.
This commit is contained in:
parent
b8f0c38101
commit
7aa27a9800
1 changed files with 6 additions and 7 deletions
|
@ -25,7 +25,6 @@
|
|||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
|
||||
package mage.watchers.common;
|
||||
|
||||
import mage.Mana;
|
||||
|
@ -60,7 +59,7 @@ public class ManaSpentToCastWatcher extends Watcher {
|
|||
public void watch(GameEvent event, Game game) {
|
||||
if (event.getType() == GameEvent.EventType.SPELL_CAST && event.getZone() == Zone.HAND) {
|
||||
Spell spell = (Spell) game.getObject(event.getTargetId());
|
||||
if (this.getSourceId().equals(spell.getSourceId())) {
|
||||
if (spell != null && this.getSourceId().equals(spell.getSourceId())) {
|
||||
payment = spell.getSpellAbility().getManaCostsToPay().getPayment();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue