# HG changeset patch # User Darkvater # Date 1168810333 0 # Node ID 86ab5e4289a5343bd0ea78eb72b14e6967310a33 # Parent c7b6e63f1996c1ce24ff811d238282de64d1307f (svn r8132) -Fix (r6824): The game could crash when the chat key () is pressed too vehemently during the join of the game. Your client's id does not exist in the clients list yet, and returns NULL. diff -r c7b6e63f1996 -r 86ab5e4289a5 src/main_gui.cpp --- a/src/main_gui.cpp Sun Jan 14 21:03:21 2007 +0000 +++ b/src/main_gui.cpp Sun Jan 14 21:32:13 2007 +0000 @@ -2302,6 +2302,8 @@ const NetworkClientInfo *cio = NetworkFindClientInfoFromIndex(_network_own_client_index); bool teamchat = false; + if (cio == NULL) break; + /* Only players actually playing can speak to team. Eg spectators cannot */ if (_patches.prefer_teamchat && IsValidPlayer(cio->client_playas)) { const NetworkClientInfo *ci; @@ -2323,8 +2325,10 @@ case WKC_CTRL | WKC_RETURN: case WKC_CTRL | 'T': // send text to all team mates if (_networking) { - const NetworkClientInfo *ci = NetworkFindClientInfoFromIndex(_network_own_client_index); - ShowNetworkChatQueryWindow(DESTTYPE_TEAM, ci->client_playas); + const NetworkClientInfo *cio = NetworkFindClientInfoFromIndex(_network_own_client_index); + if (cio == NULL) break; + + ShowNetworkChatQueryWindow(DESTTYPE_TEAM, cio->client_playas); } break; #endif