engine: server: return NULL in SV_ClientBy{Id,Name} if client array isn't allocated

This commit is contained in:
Alibek Omarov 2024-02-15 13:56:47 +03:00
parent dec71850a1
commit 2c0d6e06be

View File

@ -799,7 +799,7 @@ sv_client_t *SV_ClientById( int id )
ASSERT( id >= 0 );
for( i = 0, cl = svs.clients; i < svgame.globals->maxClients; i++, cl++ )
for( i = 0, cl = svs.clients; cl && i < svgame.globals->maxClients; i++, cl++ )
{
if( !cl->state )
continue;
@ -819,7 +819,7 @@ sv_client_t *SV_ClientByName( const char *name )
if( !COM_CheckString( name ))
return NULL;
for( i = 0, cl = svs.clients; i < svgame.globals->maxClients; i++, cl++ )
for( i = 0, cl = svs.clients; cl && i < svgame.globals->maxClients; i++, cl++ )
{
if( !cl->state )
continue;