progressNode is actually null from time to time, no need to mark it as error if we're aware of this Steam fuckup
This commit is contained in:
JustArchi
2016-12-18 15:49:06 +01:00
parent b7eac82596
commit a1cf8c91c2

View File

@@ -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;
}