From 2b8e32785d4330a4f13e03a18e6e491d3f80f015 Mon Sep 17 00:00:00 2001 From: RogueException Date: Tue, 7 Jun 2016 21:28:55 -0300 Subject: [PATCH] Fixed Guild.Features nullref --- src/Discord.Net/Entities/Guilds/Guild.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Discord.Net/Entities/Guilds/Guild.cs b/src/Discord.Net/Entities/Guilds/Guild.cs index dfd0a041e..2e3842bdb 100644 --- a/src/Discord.Net/Entities/Guilds/Guild.cs +++ b/src/Discord.Net/Entities/Guilds/Guild.cs @@ -54,14 +54,13 @@ namespace Discord EmbedChannelId = model.EmbedChannelId; AFKTimeout = model.AFKTimeout; IsEmbeddable = model.EmbedEnabled; - Features = model.Features.ToImmutableArray(); _iconId = model.Icon; Name = model.Name; OwnerId = model.OwnerId; VoiceRegionId = model.Region; _splashId = model.Splash; VerificationLevel = model.VerificationLevel; - + if (model.Emojis != null) { var emojis = ImmutableArray.CreateBuilder(model.Emojis.Length); @@ -72,6 +71,11 @@ namespace Discord else Emojis = ImmutableArray.Create(); + if (model.Features != null) + Features = model.Features.ToImmutableArray(); + else + Features = ImmutableArray.Create(); + var roles = new ConcurrentDictionary(1, model.Roles?.Length ?? 0); if (model.Roles != null) {