From a1cf8c91c284fe6bd23b27d95fe3bce2b08c4bdf Mon Sep 17 00:00:00 2001 From: JustArchi Date: Sun, 18 Dec 2016 15:49:06 +0100 Subject: [PATCH] Misc progressNode is actually null from time to time, no need to mark it as error if we're aware of this Steam fuckup --- ArchiSteamFarm/CardsFarmer.cs | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/ArchiSteamFarm/CardsFarmer.cs b/ArchiSteamFarm/CardsFarmer.cs index 63158aa20..7baacb532 100755 --- a/ArchiSteamFarm/CardsFarmer.cs +++ b/ArchiSteamFarm/CardsFarmer.cs @@ -613,17 +613,13 @@ namespace ArchiSteamFarm { } HtmlDocument htmlDocument = await Bot.ArchiWebHandler.GetGameCardsPage(appID).ConfigureAwait(false); - if (htmlDocument == null) { + + HtmlNode progressNode = htmlDocument?.DocumentNode.SelectSingleNode("//span[@class='progress_info_bold']"); + if (progressNode == null) { return null; } - HtmlNode htmlNode = htmlDocument.DocumentNode.SelectSingleNode("//span[@class='progress_info_bold']"); - if (htmlNode == null) { - Bot.ArchiLogger.LogNullError(nameof(htmlNode)); - return null; - } - - string progress = htmlNode.InnerText; + string progress = progressNode.InnerText; if (string.IsNullOrEmpty(progress)) { Bot.ArchiLogger.LogNullError(nameof(progress)); return null; @@ -635,7 +631,7 @@ namespace ArchiSteamFarm { } ushort cardsRemaining; - if (ushort.TryParse(match.Value, out cardsRemaining)) { + if (ushort.TryParse(match.Value, out cardsRemaining) && (cardsRemaining != 0)) { return cardsRemaining; }