[ServerList]: Fix crash on empty server list (#1041)
This commit is contained in:
parent
ba60e3e063
commit
ffef0d6172
@ -54,7 +54,7 @@ namespace Components
|
||||
|
||||
auto* serverInfo = ServerList::GetCurrentServer();
|
||||
|
||||
if (info)
|
||||
if (info && serverInfo)
|
||||
{
|
||||
Dvar::Var("uiSi_ServerName").set(serverInfo->hostname);
|
||||
Dvar::Var("uiSi_MaxClients").set(serverInfo->clients);
|
||||
|
@ -176,13 +176,13 @@ namespace Components
|
||||
{
|
||||
CurrentServer = index;
|
||||
|
||||
auto* info = GetCurrentServer();
|
||||
auto* serverInfo = GetCurrentServer();
|
||||
|
||||
if (info)
|
||||
if (serverInfo)
|
||||
{
|
||||
UIServerSelected.set(true);
|
||||
UIServerSelectedMap.set(info->mapname);
|
||||
Dvar::Var("ui_serverSelectedGametype").set(info->gametype);
|
||||
UIServerSelectedMap.set(serverInfo->mapname);
|
||||
Dvar::Var("ui_serverSelectedGametype").set(serverInfo->gametype);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user