Fixed possible npe in debug info generation.

This commit is contained in:
LevelX2 2014-09-07 15:44:21 +02:00
parent a42a03355e
commit da44199b3d
2 changed files with 12 additions and 12 deletions

View file

@ -207,7 +207,7 @@ public class TableManager {
}
public boolean removeTable(UUID userId, UUID tableId) {
if (UserManager.getInstance().isAdmin(userId)) {
if (isTableOwner(tableId, userId) || UserManager.getInstance().isAdmin(userId)) {
logger.debug("Table remove request - userId: " + userId + " tableId: " + tableId);
TableController tableController = controllers.get(tableId);
if (tableController != null) {
@ -386,7 +386,7 @@ public class TableManager {
try {
if (!table.getState().equals(TableState.FINISHED)) {
// remove tables and games not valid anymore
logger.debug(table.getId() + " [" + table.getName()+ "] " + formatter.format(table.getStartTime()) +" (" + table.getState().toString() + ") " + (table.isTournament() ? "- Tournament":""));
logger.debug(table.getId() + " [" + table.getName()+ "] " + formatter.format(table.getStartTime() == null ? table.getCreateTime() : table.getCreateTime()) +" (" + table.getState().toString() + ") " + (table.isTournament() ? "- Tournament":""));
TableController tableController = getController(table.getId());
if (tableController != null) {
if (table.isTournament()) {