Browse Source

Don't allow EmbedBuilder's Fields to be set to null

pull/603/head
Christopher F 8 years ago
parent
commit
662ad18586
1 changed files with 10 additions and 1 deletions
  1. +10
    -1
      src/Discord.Net.Rest/Entities/Messages/EmbedBuilder.cs

+ 10
- 1
src/Discord.Net.Rest/Entities/Messages/EmbedBuilder.cs View File

@@ -24,7 +24,16 @@ namespace Discord

public EmbedAuthorBuilder Author { get; set; }
public EmbedFooterBuilder Footer { get; set; }
public List<EmbedFieldBuilder> Fields { get; set; }
private List<EmbedFieldBuilder> _fields;
public List<EmbedFieldBuilder> Fields
{
get => _fields;
set
{
if (value != null) _fields = value;
else throw new ArgumentNullException("Cannot set an embed builder's fields collection to null", nameof(value));
}
}

public EmbedBuilder WithTitle(string title)
{


Loading…
Cancel
Save