From 7721106fc728205e6a9d575f5ebeda182b162992 Mon Sep 17 00:00:00 2001 From: Ryzhehvost Date: Sun, 23 Apr 2023 13:14:07 +0300 Subject: [PATCH] check if bot online before checking for outstanding trades (#2887) --- ArchiSteamFarm/Steam/Bot.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ArchiSteamFarm/Steam/Bot.cs b/ArchiSteamFarm/Steam/Bot.cs index 189072971..ef0204fba 100644 --- a/ArchiSteamFarm/Steam/Bot.cs +++ b/ArchiSteamFarm/Steam/Bot.cs @@ -3195,7 +3195,11 @@ public sealed class Bot : IAsyncDisposable, IDisposable { await CheckOccupationStatus().ConfigureAwait(false); } - private void OnTradeCheckTimer(object? state = null) => Utilities.InBackground(Trading.OnNewTrade); + private void OnTradeCheckTimer(object? state = null) { + if (IsConnectedAndLoggedOn) { + Utilities.InBackground(Trading.OnNewTrade); + } + } private void OnUserNotifications(UserNotificationsCallback callback) { ArgumentNullException.ThrowIfNull(callback);