@@ -115,7 +115,7 @@ void CTeamMenu::ApplySchemeSettings(IScheme *pScheme)
115115
116116 if ( *m_szMapName )
117117 {
118- LoadMapPage ( m_szMapName ); // reload the map description to pick up the color
118+ LoadMapPage ( NULL ); // reload the map description to pick up the color
119119 }
120120}
121121
@@ -185,22 +185,23 @@ void CTeamMenu::Update()
185185void CTeamMenu::LoadMapPage ( const char *mapName )
186186{
187187 // Save off the map name so we can re-load the page in ApplySchemeSettings().
188- Q_strncpy ( m_szMapName, mapName, strlen ( mapName ) + 1 );
189-
188+ if ( mapName )
189+ Q_strncpy ( m_szMapName, mapName, strlen ( mapName ) + 1 );
190+
190191 char mapRES[ MAX_PATH ];
191192
192193 char uilanguage[ 64 ];
193194 uilanguage[0 ] = 0 ;
194195 engine->GetUILanguage ( uilanguage, sizeof ( uilanguage ) );
195196
196- Q_snprintf ( mapRES, sizeof ( mapRES ), " resource/maphtml/%s_%s.html" , mapName , uilanguage );
197+ Q_snprintf ( mapRES, sizeof ( mapRES ), " resource/maphtml/%s_%s.html" , m_szMapName , uilanguage );
197198
198199 bool bFoundHTML = false ;
199200
200201 if ( !g_pFullFileSystem->FileExists ( mapRES ) )
201202 {
202203 // try english
203- Q_snprintf ( mapRES, sizeof ( mapRES ), " resource/maphtml/%s_english.html" , mapName );
204+ Q_snprintf ( mapRES, sizeof ( mapRES ), " resource/maphtml/%s_english.html" , m_szMapName );
204205 }
205206 else
206207 {
@@ -240,7 +241,7 @@ void CTeamMenu::LoadMapPage( const char *mapName )
240241#endif
241242 }
242243
243- Q_snprintf ( mapRES, sizeof ( mapRES ), " maps/%s.txt" , mapName );
244+ Q_snprintf ( mapRES, sizeof ( mapRES ), " maps/%s.txt" , m_szMapName );
244245
245246 // if no map specific description exists, load default text
246247 if ( !g_pFullFileSystem->FileExists ( mapRES ) )
0 commit comments