1
0
mirror of https://github.com/moparisthebest/minetest synced 2024-12-22 07:38:48 -05:00

Fix potential crash in chat handling (since 2f56a00d9e)

This commit is contained in:
sfan5 2017-01-22 20:17:13 +01:00
parent 39123fcce5
commit 43822de5c6

View File

@ -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); 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; peer_id_to_avoid_sending = PEER_ID_INEXISTENT;
for (u16 i = 0; i < clients.size(); i++) { for (u16 i = 0; i < clients.size(); i++) {