fixed several NPEs on server

This commit is contained in:
BetaSteward 2011-10-20 12:49:31 -04:00
parent 621e0fb4b1
commit ca6e1556f0
5 changed files with 16 additions and 7 deletions

View file

@ -451,8 +451,11 @@ public class MageServerImpl implements MageServer {
@Override
public boolean isTableOwner(String sessionId, UUID roomId, UUID tableId) throws MageException {
try {
UUID userId = SessionManager.getInstance().getSession(sessionId).getUserId();
return TableManager.getInstance().isTableOwner(tableId, userId);
Session session = SessionManager.getInstance().getSession(sessionId);
if (session != null) {
UUID userId = SessionManager.getInstance().getSession(sessionId).getUserId();
return TableManager.getInstance().isTableOwner(tableId, userId);
}
}
catch (Exception ex) {
handleException(ex);