From fad08a1fa98b9dffe1429a93d9ef9cdf5d36fbe9 Mon Sep 17 00:00:00 2001 From: JustArchi Date: Thu, 12 May 2016 16:32:04 +0200 Subject: [PATCH] Fix linking new authenticator with null password --- ArchiSteamFarm/Bot.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ArchiSteamFarm/Bot.cs b/ArchiSteamFarm/Bot.cs index 33f116f87..4de489ef4 100755 --- a/ArchiSteamFarm/Bot.cs +++ b/ArchiSteamFarm/Bot.cs @@ -485,7 +485,7 @@ namespace ArchiSteamFarm { // But here we're dealing with WinAuth authenticator Logging.LogGenericInfo("ASF requires a few more steps to complete authenticator import...", BotName); - if (!InitializeLoginAndPassword()) { + if (!InitializeLoginAndPassword(true)) { BotDatabase.SteamGuardAccount = null; return; } @@ -1289,7 +1289,7 @@ namespace ArchiSteamFarm { Logging.LogGenericInfo("Linking new ASF MobileAuthenticator...", BotName); - if (!InitializeLoginAndPassword()) { + if (!InitializeLoginAndPassword(true)) { return; } @@ -1382,7 +1382,7 @@ namespace ArchiSteamFarm { SteamFriends.JoinChat(BotConfig.SteamMasterClanID); } - private bool InitializeLoginAndPassword() { + private bool InitializeLoginAndPassword(bool requiresPassword) { if (string.IsNullOrEmpty(BotConfig.SteamLogin)) { BotConfig.SteamLogin = Program.GetUserInput(Program.EUserInputType.Login, BotName); if (string.IsNullOrEmpty(BotConfig.SteamLogin)) { @@ -1390,7 +1390,7 @@ namespace ArchiSteamFarm { } } - if (string.IsNullOrEmpty(BotConfig.SteamPassword) && string.IsNullOrEmpty(BotDatabase.LoginKey)) { + if (string.IsNullOrEmpty(BotConfig.SteamPassword) && (requiresPassword || string.IsNullOrEmpty(BotDatabase.LoginKey))) { BotConfig.SteamPassword = Program.GetUserInput(Program.EUserInputType.Password, BotName); if (string.IsNullOrEmpty(BotConfig.SteamPassword)) { return false; @@ -1428,7 +1428,7 @@ namespace ArchiSteamFarm { } } - if (!InitializeLoginAndPassword()) { + if (!InitializeLoginAndPassword(false)) { Stop(); return; }