Fixed ClassCastException for Baron Von Count
@@ -196,8 +196,9 @@ class BaronVonCountMoveDoomCounterEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
+ Permanent sourcePermanent = game.getPermanent(source.getSourceId());
MageObject mageObject = game.getObject(source.getSourceId());
- if (controller != null && mageObject != null) {
+ if (controller != null && sourcePermanent != null && mageObject != null) {
if (game.getState().getValue(mageObject.getId() + "_doom") == null) {
return false;
}
@@ -272,8 +273,9 @@ class BaronVonCountDestroyPlayerEffect extends OneShotEffect {
game.informPlayers(targetPlayer.getLogName() + " was destroyed");
targetPlayer.lost(game); // double checks canLose, but seems more future-proof than lostForced
}
+ Permanent sourcePermanent = game.getPermanent(source.getSourceId());
MageObject mageObject = game.getObject(source.getSourceId());
- if (mageObject != null) {
+ if (sourcePermanent != null && mageObject != null) {
if (game.getState().getValue(mageObject.getId() + "_doom") == null) {
return false;
}
