Narrowed variables scope.

This commit is contained in:
vraskulin 2017-02-15 16:05:18 +03:00
parent 09da478b38
commit f1ef3bf68b
20 changed files with 42 additions and 60 deletions

View file

@ -418,10 +418,10 @@ public class TournamentController {
}
// replace player that quits with draft bot
if (humans > 1) {
String replacePlayerName = "Draftbot";
Optional<User> user = UserManager.getInstance().getUser(userId);
TableController tableController = TableManager.getInstance().getController(tableId);
if (tableController != null) {
String replacePlayerName = "Draftbot";
if (user.isPresent()) {
replacePlayerName = "Draftbot (" + user.get().getName() + ')';
}