From 0b80e69c4d1ac869b9d6c1c72edfe71fffdd7398 Mon Sep 17 00:00:00 2001 From: JustArchi Date: Wed, 28 Sep 2016 15:07:52 +0200 Subject: [PATCH] Fix LoginLimiter being ignored on non-ASF 2FA accounts --- ArchiSteamFarm/Bot.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ArchiSteamFarm/Bot.cs b/ArchiSteamFarm/Bot.cs index b6a55ac72..f1665408d 100755 --- a/ArchiSteamFarm/Bot.cs +++ b/ArchiSteamFarm/Bot.cs @@ -541,11 +541,13 @@ namespace ArchiSteamFarm { } // Use limiter only when user is not providing 2FA token by himself - if (string.IsNullOrEmpty(TwoFactorCode) && (BotDatabase.MobileAuthenticator != null)) { + if (string.IsNullOrEmpty(TwoFactorCode)) { await LimitLoginRequestsAsync().ConfigureAwait(false); - // In this case, we can also use ASF 2FA for providing 2FA token, even if it's not required - TwoFactorCode = await BotDatabase.MobileAuthenticator.GenerateToken().ConfigureAwait(false); + if (BotDatabase.MobileAuthenticator != null) { + // In this case, we can also use ASF 2FA for providing 2FA token, even if it's not required + TwoFactorCode = await BotDatabase.MobileAuthenticator.GenerateToken().ConfigureAwait(false); + } } lock (SteamClient) {