dvar nullptr check

This commit is contained in:
BrentVL-1952840 2023-02-16 23:52:51 +01:00
parent 38f4387c52
commit dfe4b43502

View File

@ -209,8 +209,11 @@ namespace console
{
scheduler::once([]()
{
const auto server_name = game::Dvar_FindVar("live_steam_server_name")->current.string;
SetWindowTextA(*game::s_wcd::hWnd, server_name);
const auto server_name_dvar = game::Dvar_FindVar("live_steam_server_name");
if (server_name_dvar)
{
SetWindowTextA(*game::s_wcd::hWnd, server_name_dvar->current.string);
}
}, scheduler::pipeline::main);
}