mirror of
https://github.com/magefree/mage.git
synced 2025-12-22 03:22:00 -08: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 black = 0;
|
||||||
private int colorless = 0;
|
private int colorless = 0;
|
||||||
private ConditionalMana conditionalMana;
|
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 UUID originalId; // originalId of the mana producing ability
|
||||||
private boolean flag = false;
|
private boolean flag = false;
|
||||||
private Duration duration;
|
private Duration duration;
|
||||||
|
|
|
||||||
|
|
@ -59,10 +59,10 @@ public class ManaPaidSourceWatcher extends Watcher {
|
||||||
|
|
||||||
private void increment(MageObject sourceObject, ManaType manaType, Game game) {
|
private void increment(MageObject sourceObject, ManaType manaType, Game game) {
|
||||||
total++;
|
total++;
|
||||||
if (sourceObject.hasSubtype(SubType.TREASURE, game)) {
|
if (sourceObject != null && sourceObject.hasSubtype(SubType.TREASURE, game)) {
|
||||||
treasure++;
|
treasure++;
|
||||||
}
|
}
|
||||||
if (!sourceObject.isSnow()) {
|
if (sourceObject != null && !sourceObject.isSnow()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
switch (manaType) {
|
switch (manaType) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue