From d4a5ac134697fb45a53adbc8a4ee08e674748205 Mon Sep 17 00:00:00 2001 From: FutureRave Date: Sun, 30 Apr 2023 11:14:06 +0100 Subject: [PATCH] maint(auth): only write keys if there is anything to write --- src/client/component/auth.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/client/component/auth.cpp b/src/client/component/auth.cpp index ca6ec9a3..2be9bab5 100644 --- a/src/client/component/auth.cpp +++ b/src/client/component/auth.cpp @@ -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