From 541d5aac0dc3153d910f348a501982daa43c49e3 Mon Sep 17 00:00:00 2001 From: JustArchi Date: Thu, 31 Dec 2020 18:30:11 +0100 Subject: [PATCH] Closes #2109 --- ArchiSteamFarm/Bot.cs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/ArchiSteamFarm/Bot.cs b/ArchiSteamFarm/Bot.cs index 3b09fc865..262ca5445 100755 --- a/ArchiSteamFarm/Bot.cs +++ b/ArchiSteamFarm/Bot.cs @@ -2268,10 +2268,27 @@ namespace ArchiSteamFarm { const string nonAsciiPattern = @"[^\u0000-\u007F]+"; string username = Regex.Replace(BotConfig.SteamLogin!, nonAsciiPattern, "", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); + + if (string.IsNullOrEmpty(username)) { + ArchiLogger.LogGenericError(string.Format(CultureInfo.CurrentCulture, Strings.ErrorIsInvalid, nameof(BotConfig.SteamLogin))); + + Stop(); + + return; + } + string? password = BotConfig.DecryptedSteamPassword; if (!string.IsNullOrEmpty(password)) { password = Regex.Replace(password!, nonAsciiPattern, "", RegexOptions.CultureInvariant | RegexOptions.IgnoreCase); + + if (string.IsNullOrEmpty(password)) { + ArchiLogger.LogGenericError(string.Format(CultureInfo.CurrentCulture, Strings.ErrorIsInvalid, nameof(BotConfig.SteamPassword))); + + Stop(); + + return; + } } ArchiLogger.LogGenericInfo(Strings.BotLoggingIn);