[ServerList]: Fix crash on empty server list (#1041)

This commit is contained in:
Edo 2023-05-14 21:56:56 +01:00 committed by GitHub
parent ba60e3e063
commit ffef0d6172
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View File

@ -54,7 +54,7 @@ namespace Components
auto* serverInfo = ServerList::GetCurrentServer(); auto* serverInfo = ServerList::GetCurrentServer();
if (info) if (info && serverInfo)
{ {
Dvar::Var("uiSi_ServerName").set(serverInfo->hostname); Dvar::Var("uiSi_ServerName").set(serverInfo->hostname);
Dvar::Var("uiSi_MaxClients").set(serverInfo->clients); Dvar::Var("uiSi_MaxClients").set(serverInfo->clients);

View File

@ -176,13 +176,13 @@ namespace Components
{ {
CurrentServer = index; CurrentServer = index;
auto* info = GetCurrentServer(); auto* serverInfo = GetCurrentServer();
if (info) if (serverInfo)
{ {
UIServerSelected.set(true); UIServerSelected.set(true);
UIServerSelectedMap.set(info->mapname); UIServerSelectedMap.set(serverInfo->mapname);
Dvar::Var("ui_serverSelectedGametype").set(info->gametype); Dvar::Var("ui_serverSelectedGametype").set(serverInfo->gametype);
} }
else else
{ {