mirror of
https://github.com/correl/mage.git
synced 2025-04-10 17:00:08 -09:00
Fixed two possible NPE.
This commit is contained in:
parent
a2f1d08474
commit
43da29da44
2 changed files with 5 additions and 2 deletions
Mage.Server.Plugins/Mage.Player.Human/src/mage/player/human
Mage/src/mage/game/combat
|
@ -716,8 +716,8 @@ public class HumanPlayer extends PlayerImpl<HumanPlayer> {
|
||||||
updateGameStatePriority("getAmount", game);
|
updateGameStatePriority("getAmount", game);
|
||||||
game.fireGetAmountEvent(playerId, message, min, max);
|
game.fireGetAmountEvent(playerId, message, min, max);
|
||||||
waitForIntegerResponse(game);
|
waitForIntegerResponse(game);
|
||||||
if (response != null) {
|
if (response != null && response.getInteger() != null) {
|
||||||
return response.getInteger();
|
return response.getInteger().intValue();
|
||||||
} else {
|
} else {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -559,6 +559,9 @@ public class Combat implements Serializable, Copyable<Combat> {
|
||||||
for (Map.Entry<UUID, Set<UUID>> entry :creaturesForcedToBlockAttackers.entrySet()) {
|
for (Map.Entry<UUID, Set<UUID>> entry :creaturesForcedToBlockAttackers.entrySet()) {
|
||||||
boolean blockIsValid;
|
boolean blockIsValid;
|
||||||
Permanent creatureForcedToBlock = game.getPermanent(entry.getKey());
|
Permanent creatureForcedToBlock = game.getPermanent(entry.getKey());
|
||||||
|
if (creatureForcedToBlock == null) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
// creature does not block -> not allowed
|
// creature does not block -> not allowed
|
||||||
if (creatureForcedToBlock.getBlocking() == 0) {
|
if (creatureForcedToBlock.getBlocking() == 0) {
|
||||||
blockIsValid = false;
|
blockIsValid = false;
|
||||||
|
|
Loading…
Add table
Reference in a new issue