Commit b462f953 authored by Fabio Bas's avatar Fabio Bas
Browse files

Warning/ban notifications: null check userInfo pointer before dereferencing it

parent f31a89eb
...@@ -268,7 +268,12 @@ QList<QString> Server::getOnlineModeratorList() ...@@ -268,7 +268,12 @@ QList<QString> Server::getOnlineModeratorList()
QList<QString> results; QList<QString> results;
for (int i = 0; i < clients.size(); ++i) { for (int i = 0; i < clients.size(); ++i) {
ServerInfo_User *data = clients[i]->getUserInfo(); ServerInfo_User *data = clients[i]->getUserInfo();
if (data->user_level() & ServerInfo_User::IsModerator || data->user_level() & ServerInfo_User::IsAdmin) //TODO: this line should be updated in the event there is any type of new user level created
//TODO: this line should be updated in the event there is any type of new user level created
if (data &&
(data->user_level() & ServerInfo_User::IsModerator ||
data->user_level() & ServerInfo_User::IsAdmin)
)
results << QString::fromStdString(data->name()).simplified(); results << QString::fromStdString(data->name()).simplified();
} }
return results; return results;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment