server crash fix
This commit is contained in:
parent
ca3a7e69a1
commit
6ca1d1f09f
1 changed files with 4 additions and 0 deletions
|
@ -147,6 +147,8 @@ ResponseCode Server_ProtocolHandler::processCommandHelper(Command *command, Comm
|
||||||
ModeratorCommand *moderatorCommand = qobject_cast<ModeratorCommand *>(command);
|
ModeratorCommand *moderatorCommand = qobject_cast<ModeratorCommand *>(command);
|
||||||
if (moderatorCommand) {
|
if (moderatorCommand) {
|
||||||
qDebug() << "received ModeratorCommand";
|
qDebug() << "received ModeratorCommand";
|
||||||
|
if (!userInfo)
|
||||||
|
return RespLoginNeeded;
|
||||||
if (!(userInfo->getUserLevel() & ServerInfo_User::IsModerator))
|
if (!(userInfo->getUserLevel() & ServerInfo_User::IsModerator))
|
||||||
return RespLoginNeeded;
|
return RespLoginNeeded;
|
||||||
|
|
||||||
|
@ -158,6 +160,8 @@ ResponseCode Server_ProtocolHandler::processCommandHelper(Command *command, Comm
|
||||||
AdminCommand *adminCommand = qobject_cast<AdminCommand *>(command);
|
AdminCommand *adminCommand = qobject_cast<AdminCommand *>(command);
|
||||||
if (adminCommand) {
|
if (adminCommand) {
|
||||||
qDebug() << "received AdminCommand";
|
qDebug() << "received AdminCommand";
|
||||||
|
if (!userInfo)
|
||||||
|
return RespLoginNeeded;
|
||||||
if (!(userInfo->getUserLevel() & ServerInfo_User::IsAdmin))
|
if (!(userInfo->getUserLevel() & ServerInfo_User::IsAdmin))
|
||||||
return RespLoginNeeded;
|
return RespLoginNeeded;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue