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([]() scheduler::once([]()
{ {
const auto server_name = game::Dvar_FindVar("live_steam_server_name")->current.string; const auto server_name_dvar = game::Dvar_FindVar("live_steam_server_name");
SetWindowTextA(*game::s_wcd::hWnd, server_name); if (server_name_dvar)
{
SetWindowTextA(*game::s_wcd::hWnd, server_name_dvar->current.string);
}
}, scheduler::pipeline::main); }, scheduler::pipeline::main);
} }