Some changes to logged data and a NPE prevention.

This commit is contained in:
LevelX2 2016-04-14 08:28:28 +02:00
parent 3e4c9dc645
commit 41ba4c9540
3 changed files with 19 additions and 14 deletions

View file

@ -1159,6 +1159,9 @@ public abstract class AbilityImpl implements Ability {
public MageObject getSourceObject(Game game) {
if (sourceObject == null) {
setSourceObject(null, game);
if (sourceObject == null) {
logger.warn("Source object could not be retrieved: " + this.getRule());
}
}
return sourceObject;
}

View file

@ -106,7 +106,10 @@ public class ManaPoolItem implements Serializable {
}
public UUID getSourceId() {
return sourceObject.getId();
if (sourceObject != null) {
return sourceObject.getId();
}
return null;
}
public UUID getOriginalId() {