From 6ca1d1f09f636429c7d7ba35408300b157e43d5d Mon Sep 17 00:00:00 2001 From: Max-Wilhelm Bruker Date: Sun, 18 Dec 2011 12:59:04 +0100 Subject: [PATCH] server crash fix --- common/server_protocolhandler.cpp | 4 ++++ 1 file changed, 4 insertions(+) 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;