server crash fix

This commit is contained in:
Max-Wilhelm Bruker 2011-12-18 12:59:04 +01:00
parent ca3a7e69a1
commit 6ca1d1f09f

View file

@ -147,6 +147,8 @@ ResponseCode Server_ProtocolHandler::processCommandHelper(Command *command, Comm
ModeratorCommand *moderatorCommand = qobject_cast<ModeratorCommand *>(command);
if (moderatorCommand) {
qDebug() << "received ModeratorCommand";
if (!userInfo)
return RespLoginNeeded;
if (!(userInfo->getUserLevel() & ServerInfo_User::IsModerator))
return RespLoginNeeded;
@ -158,6 +160,8 @@ ResponseCode Server_ProtocolHandler::processCommandHelper(Command *command, Comm
AdminCommand *adminCommand = qobject_cast<AdminCommand *>(command);
if (adminCommand) {
qDebug() << "received AdminCommand";
if (!userInfo)
return RespLoginNeeded;
if (!(userInfo->getUserLevel() & ServerInfo_User::IsAdmin))
return RespLoginNeeded;