mirror of
https://github.com/correl/mage.git
synced 2024-12-24 11:50:45 +00:00
Fixed NPE in ManaPaid events usage
This commit is contained in:
parent
ad3b76dae6
commit
1bc4b9d675
2 changed files with 3 additions and 3 deletions
|
@ -22,7 +22,7 @@ public class ManaPoolItem implements Serializable, Emptiable {
|
|||
private int black = 0;
|
||||
private int colorless = 0;
|
||||
private ConditionalMana conditionalMana;
|
||||
private MageObject sourceObject;
|
||||
private MageObject sourceObject; // source of the mana, can be null (what's use case for null values? JayDi85)
|
||||
private UUID originalId; // originalId of the mana producing ability
|
||||
private boolean flag = false;
|
||||
private Duration duration;
|
||||
|
|
|
@ -59,10 +59,10 @@ public class ManaPaidSourceWatcher extends Watcher {
|
|||
|
||||
private void increment(MageObject sourceObject, ManaType manaType, Game game) {
|
||||
total++;
|
||||
if (sourceObject.hasSubtype(SubType.TREASURE, game)) {
|
||||
if (sourceObject != null && sourceObject.hasSubtype(SubType.TREASURE, game)) {
|
||||
treasure++;
|
||||
}
|
||||
if (!sourceObject.isSnow()) {
|
||||
if (sourceObject != null && !sourceObject.isSnow()) {
|
||||
return;
|
||||
}
|
||||
switch (manaType) {
|
||||
|
|
Loading…
Reference in a new issue