Skip to content

Commit

Permalink
Fix potential crash in chat handling (since 2f56a00)
Browse files Browse the repository at this point in the history
  • Loading branch information
sfan5 committed Jan 22, 2017
1 parent 39123fc commit 43822de
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/server.cpp
Expand Up @@ -2864,7 +2864,7 @@ std::wstring Server::handleChat(const std::string &name, const std::wstring &wna
*/

u16 peer_id_to_avoid_sending = (player ? player->peer_id : PEER_ID_INEXISTENT);
if (player->protocol_version >= 29)
if (player && player->protocol_version >= 29)
peer_id_to_avoid_sending = PEER_ID_INEXISTENT;

for (u16 i = 0; i < clients.size(); i++) {
Expand Down

0 comments on commit 43822de

Please sign in to comment.