forked from External/mage
Fix Clash effect causing NullPointerExceptions (#10742)
This commit is contained in:
parent
005f32cfff
commit
4d3b944b65
4 changed files with 24 additions and 16 deletions
|
|
@ -4,6 +4,7 @@ import mage.abilities.MageSingleton;
|
|||
import mage.abilities.Mode;
|
||||
import mage.constants.EffectType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.players.Player;
|
||||
import mage.target.targetpointer.FirstTargetPointer;
|
||||
import mage.target.targetpointer.TargetPointer;
|
||||
|
||||
|
|
@ -104,6 +105,12 @@ public abstract class EffectImpl implements Effect {
|
|||
values = new HashMap<>();
|
||||
}
|
||||
}
|
||||
if (value instanceof Player) {
|
||||
// If Player are set as value, there might be PlayerImpl serialized in ClientMessage's GameView.
|
||||
// That does cause the message's data to not be unzippable, since the PlayerImpl class are not
|
||||
// client-side.
|
||||
throw new IllegalArgumentException("Players should not be set as value, set the UUID instead.");
|
||||
}
|
||||
values.put(key, value);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue