diff --git a/common/server_protocolhandler.cpp b/common/server_protocolhandler.cpp index bdb887c8..8a7336f8 100644 --- a/common/server_protocolhandler.cpp +++ b/common/server_protocolhandler.cpp @@ -147,6 +147,8 @@ ResponseCode Server_ProtocolHandler::processCommandHelper(Command *command, Comm ModeratorCommand *moderatorCommand = qobject_cast(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(command); if (adminCommand) { qDebug() << "received AdminCommand"; + if (!userInfo) + return RespLoginNeeded; if (!(userInfo->getUserLevel() & ServerInfo_User::IsAdmin)) return RespLoginNeeded;