mirror of
https://github.com/correl/mage.git
synced 2025-04-01 19:07:57 -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);
|
||||
game.fireGetAmountEvent(playerId, message, min, max);
|
||||
waitForIntegerResponse(game);
|
||||
if (response != null) {
|
||||
return response.getInteger();
|
||||
if (response != null && response.getInteger() != null) {
|
||||
return response.getInteger().intValue();
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -559,6 +559,9 @@ public class Combat implements Serializable, Copyable<Combat> {
|
|||
for (Map.Entry<UUID, Set<UUID>> entry :creaturesForcedToBlockAttackers.entrySet()) {
|
||||
boolean blockIsValid;
|
||||
Permanent creatureForcedToBlock = game.getPermanent(entry.getKey());
|
||||
if (creatureForcedToBlock == null) {
|
||||
break;
|
||||
}
|
||||
// creature does not block -> not allowed
|
||||
if (creatureForcedToBlock.getBlocking() == 0) {
|
||||
blockIsValid = false;
|
||||
|
|
Loading…
Add table
Reference in a new issue