From a17de3dc58ba46a8ead474f110d80577cf168788 Mon Sep 17 00:00:00 2001 From: Master Kwoth Date: Sun, 29 Oct 2017 09:25:50 +0100 Subject: [PATCH] Fixed patreon error --- .../Modules/Utility/Services/PatreonRewardsService.cs | 9 ++++++--- NadekoBot.Core/Services/Impl/StatsService.cs | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/NadekoBot.Core/Modules/Utility/Services/PatreonRewardsService.cs b/NadekoBot.Core/Modules/Utility/Services/PatreonRewardsService.cs index 1deb8f5f..ae259ee1 100644 --- a/NadekoBot.Core/Modules/Utility/Services/PatreonRewardsService.cs +++ b/NadekoBot.Core/Modules/Utility/Services/PatreonRewardsService.cs @@ -93,9 +93,12 @@ namespace NadekoBot.Modules.Utility.Services var pledgers = data.Data.Where(x => x["type"].ToString() == "pledge"); rewards.AddRange(pledgers.Select(x => JsonConvert.DeserializeObject(x.ToString())) .Where(x => x.attributes.declined_since == null)); - users.AddRange(data.Included - .Where(x => x["type"].ToString() == "user") - .Select(x => JsonConvert.DeserializeObject(x.ToString()))); + if (data.Included != null) + { + users.AddRange(data.Included + .Where(x => x["type"].ToString() == "user") + .Select(x => JsonConvert.DeserializeObject(x.ToString()))); + } } while (!string.IsNullOrWhiteSpace(data.Links.next)); } var db = _cache.Redis.GetDatabase(); diff --git a/NadekoBot.Core/Services/Impl/StatsService.cs b/NadekoBot.Core/Services/Impl/StatsService.cs index ec61e51f..540b5304 100644 --- a/NadekoBot.Core/Services/Impl/StatsService.cs +++ b/NadekoBot.Core/Services/Impl/StatsService.cs @@ -21,7 +21,7 @@ namespace NadekoBot.Core.Services.Impl private readonly IBotCredentials _creds; private readonly DateTime _started; - public const string BotVersion = "2.2.2"; + public const string BotVersion = "2.2.3"; public string Author => "Kwoth#2560"; public string Library => "Discord.Net";