mirror of
https://github.com/correl/mage.git
synced 2024-12-25 11:11:16 +00:00
* Fixed possible null pointer exception.
This commit is contained in:
parent
6fe58db97d
commit
5701c36446
2 changed files with 8 additions and 3 deletions
|
@ -280,9 +280,9 @@ public class GameSessionPlayer extends GameSessionWatcher {
|
||||||
logger.fatal("Game session game quit exception " + (ex.getMessage() == null ? "null":ex.getMessage()));
|
logger.fatal("Game session game quit exception " + (ex.getMessage() == null ? "null":ex.getMessage()));
|
||||||
logger.debug("- gameId:" + game.getId() +" playerId: " + playerId);
|
logger.debug("- gameId:" + game.getId() +" playerId: " + playerId);
|
||||||
if (ex.getCause() != null) {
|
if (ex.getCause() != null) {
|
||||||
logger.debug("- Cause: " + (ex.getCause().getMessage() == null ? "null":ex.getCause().getMessage()));
|
logger.debug("- Cause: " + (ex.getCause().getMessage() == null ? "null":ex.getCause().getMessage()), ex);
|
||||||
} else {
|
} else {
|
||||||
logger.debug("- ex: " + ex.toString());
|
logger.debug("- ex: " + ex.toString(), ex);
|
||||||
}
|
}
|
||||||
}else {
|
}else {
|
||||||
logger.fatal("Game session game quit exception - null gameId:" + game.getId() +" playerId: " + playerId);
|
logger.fatal("Game session game quit exception - null gameId:" + game.getId() +" playerId: " + playerId);
|
||||||
|
|
|
@ -196,7 +196,12 @@ public class TargetPlayer extends TargetImpl {
|
||||||
public String getTargetedName(Game game) {
|
public String getTargetedName(Game game) {
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
for (UUID targetId: getTargets()) {
|
for (UUID targetId: getTargets()) {
|
||||||
sb.append(game.getPlayer(targetId).getName()).append(" ");
|
Player player = game.getPlayer(targetId);
|
||||||
|
if (player != null) {
|
||||||
|
sb.append(player.getName()).append(" ");
|
||||||
|
} else {
|
||||||
|
sb.append("[target missing]");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return sb.toString();
|
return sb.toString();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue