Fix crash regression when chatting in the ncurses console

Fixes #4579, a regression introduced by commit

d4c76258e3 "Chat: new settings to prevent spam"
This commit is contained in:
est31 2016-10-06 03:32:52 +02:00 committed by Ner'zhul
parent 61d1751dff
commit de83c29ba0
1 changed files with 14 additions and 12 deletions

View File

@ -2751,6 +2751,7 @@ std::wstring Server::handleChat(const std::string &name, const std::wstring &wna
if (ate)
return L"";
if (player) {
switch (player->canSendChatMessage()) {
case RPLAYER_CHATRESULT_FLOODING: {
std::wstringstream ws;
@ -2765,6 +2766,7 @@ std::wstring Server::handleChat(const std::string &name, const std::wstring &wna
case RPLAYER_CHATRESULT_OK: break;
default: FATAL_ERROR("Unhandled chat filtering result found.");
}
}
if (m_max_chatmessage_length > 0 && wmessage.length() > m_max_chatmessage_length) {
return L"Your message exceed the maximum chat message limit set on the server. "