diff --git a/ArchiSteamFarm/CardsFarmer.cs b/ArchiSteamFarm/CardsFarmer.cs index e82b80cef..9e49185cc 100755 --- a/ArchiSteamFarm/CardsFarmer.cs +++ b/ArchiSteamFarm/CardsFarmer.cs @@ -370,9 +370,9 @@ namespace ArchiSteamFarm { ushort cardsRemaining = 0; Match progressMatch = Regex.Match(progressText, @"\d+"); - // This might fail if we have no card drops remaining, that's fine + // This might fail if we have no card drops remaining, 0 is not printed in this case - that's fine if (progressMatch.Success) { - if (!ushort.TryParse(progressMatch.Value, out cardsRemaining)) { + if (!ushort.TryParse(progressMatch.Value, out cardsRemaining) || (cardsRemaining == 0)) { Bot.ArchiLogger.LogNullError(nameof(cardsRemaining)); continue; } @@ -435,12 +435,12 @@ namespace ArchiSteamFarm { continue; } - float hours = 0; + float hours = 0.0F; Match hoursMatch = Regex.Match(hoursString, @"[0-9\.,]+"); - // This might fail if we have exactly 0.0 hours played, that's fine + // This might fail if we have exactly 0.0 hours played, as it's not printed in that case - that's fine if (hoursMatch.Success) { - if (!float.TryParse(hoursMatch.Value, NumberStyles.Number, CultureInfo.InvariantCulture, out hours)) { + if (!float.TryParse(hoursMatch.Value, NumberStyles.Number, CultureInfo.InvariantCulture, out hours) || (hours <= 0.0F)) { Bot.ArchiLogger.LogNullError(nameof(hours)); continue; }