* Fixed that a delayed sacrifice source effect could create a null pointer exception.

This commit is contained in:
LevelX2 2016-05-16 11:07:18 +02:00
parent 77b32014f6
commit 20138891fe
3 changed files with 56 additions and 1 deletions

View file

@ -62,7 +62,7 @@ public class SacrificeSourceEffect extends OneShotEffect {
// Check if the effect was installed by the spell the source was cast by (e.g. Necromancy), if not don't sacrifice the permanent
if (source.getSourceObject(game) instanceof Spell) {
sourceObject = game.getPermanent(source.getSourceId());
if (sourceObject.getZoneChangeCounter(game) > source.getSourceObjectZoneChangeCounter() + 1) {
if (sourceObject != null && sourceObject.getZoneChangeCounter(game) > source.getSourceObjectZoneChangeCounter() + 1) {
return false;
}
}