Browse Source

Fixed Guild.Features nullref

pull/97/head
RogueException 9 years ago
parent
commit
2b8e32785d
1 changed files with 6 additions and 2 deletions
  1. +6
    -2
      src/Discord.Net/Entities/Guilds/Guild.cs

+ 6
- 2
src/Discord.Net/Entities/Guilds/Guild.cs View File

@@ -54,14 +54,13 @@ namespace Discord
EmbedChannelId = model.EmbedChannelId; EmbedChannelId = model.EmbedChannelId;
AFKTimeout = model.AFKTimeout; AFKTimeout = model.AFKTimeout;
IsEmbeddable = model.EmbedEnabled; IsEmbeddable = model.EmbedEnabled;
Features = model.Features.ToImmutableArray();
_iconId = model.Icon; _iconId = model.Icon;
Name = model.Name; Name = model.Name;
OwnerId = model.OwnerId; OwnerId = model.OwnerId;
VoiceRegionId = model.Region; VoiceRegionId = model.Region;
_splashId = model.Splash; _splashId = model.Splash;
VerificationLevel = model.VerificationLevel; VerificationLevel = model.VerificationLevel;
if (model.Emojis != null) if (model.Emojis != null)
{ {
var emojis = ImmutableArray.CreateBuilder<Emoji>(model.Emojis.Length); var emojis = ImmutableArray.CreateBuilder<Emoji>(model.Emojis.Length);
@@ -72,6 +71,11 @@ namespace Discord
else else
Emojis = ImmutableArray.Create<Emoji>(); Emojis = ImmutableArray.Create<Emoji>();


if (model.Features != null)
Features = model.Features.ToImmutableArray();
else
Features = ImmutableArray.Create<string>();

var roles = new ConcurrentDictionary<ulong, Role>(1, model.Roles?.Length ?? 0); var roles = new ConcurrentDictionary<ulong, Role>(1, model.Roles?.Length ?? 0);
if (model.Roles != null) if (model.Roles != null)
{ {


Loading…
Cancel
Save