mirror of
https://github.com/magefree/mage.git
synced 2025-12-24 20:41:58 -08:00
Fixed various potential null pointer exceptions
This commit is contained in:
parent
86f7a663b4
commit
ab3cd76d3e
44 changed files with 438 additions and 439 deletions
|
|
@ -103,7 +103,7 @@ public class DoUnlessTargetPlayerOrTargetsControllerPaysEffect extends OneShotEf
|
|||
}
|
||||
if (targetController != null) {
|
||||
MageObject sourceObject = game.getObject(source.getSourceId());
|
||||
if (targetController != null && sourceObject != null) {
|
||||
if (sourceObject != null) {
|
||||
Cost costToPay;
|
||||
if (cost != null) {
|
||||
costToPay = cost.copy();
|
||||
|
|
@ -120,7 +120,7 @@ public class DoUnlessTargetPlayerOrTargetsControllerPaysEffect extends OneShotEf
|
|||
message = CardUtil.replaceSourceName(message, sourceObject.getName());
|
||||
boolean result = true;
|
||||
boolean doEffect = true;
|
||||
|
||||
|
||||
// check if targetController is willing to pay
|
||||
if (costToPay.canPay(source, source.getSourceId(), targetController.getId(), game) && targetController.chooseUse(Outcome.Detriment, message, source, game)) {
|
||||
costToPay.clearPaid();
|
||||
|
|
@ -128,10 +128,10 @@ public class DoUnlessTargetPlayerOrTargetsControllerPaysEffect extends OneShotEf
|
|||
if (!game.isSimulation()) {
|
||||
game.informPlayers(targetController.getLogName() + " pays the cost to prevent the effect");
|
||||
}
|
||||
doEffect = false;
|
||||
doEffect = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// do the effects if not paid
|
||||
if (doEffect) {
|
||||
for (Effect effect : executingEffects) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue