diff --git a/ArchiSteamFarm/IPC/Integration/ApiAuthenticationMiddleware.cs b/ArchiSteamFarm/IPC/Integration/ApiAuthenticationMiddleware.cs index 54d6366cb..d71e3e00c 100644 --- a/ArchiSteamFarm/IPC/Integration/ApiAuthenticationMiddleware.cs +++ b/ArchiSteamFarm/IPC/Integration/ApiAuthenticationMiddleware.cs @@ -102,7 +102,13 @@ namespace ArchiSteamFarm.IPC.Integration { return HttpStatusCode.Unauthorized; } - bool authorized = passwords.First() == ASF.GlobalConfig.IPCPassword; + string inputPassword = passwords.FirstOrDefault(password => !string.IsNullOrEmpty(password)); + + if (string.IsNullOrEmpty(inputPassword)) { + return HttpStatusCode.Unauthorized; + } + + bool authorized = inputPassword == ASF.GlobalConfig.IPCPassword; await AuthorizationSemaphore.WaitAsync().ConfigureAwait(false);