maint(auth): only write keys if there is anything to write

This commit is contained in:
FutureRave 2023-04-30 11:14:06 +01:00
parent 17043246ba
commit d4a5ac1346

View File

@ -330,10 +330,16 @@ namespace auth
{
game::Info_SetValueForKey(s, key, value);
const auto password_text = (password && password->current.value.string) ? password->current.value.string : "";
game::Info_SetValueForKey(s, "password", password_text);
if (password && *password->current.value.string)
{
game::Info_SetValueForKey(s, "password", password->current.value.string);
}
game::Info_SetValueForKey(s, "clanAbbrev", game::LiveStats_GetClanTagText(0));
const auto* clan_abbrev = game::LiveStats_GetClanTagText(0);
if (*clan_abbrev)
{
game::Info_SetValueForKey(s, "clanAbbrev", clan_abbrev);
}
}
struct component final : generic_component