| @@ -44,7 +44,7 @@ namespace Discord | |||||
| get => _embed.Url; | get => _embed.Url; | ||||
| set | set | ||||
| { | { | ||||
| if (!Uri.IsWellFormedUriString(value, UriKind.Absolute)) throw new ArgumentException("Url must be a well-formed URI", nameof(Url)); | |||||
| if (!string.IsNullOrEmpty(value) && !Uri.IsWellFormedUriString(value, UriKind.Absolute)) throw new ArgumentException("Url must be a well-formed URI", nameof(Url)); | |||||
| _embed.Url = value; | _embed.Url = value; | ||||
| } | } | ||||
| } | } | ||||
| @@ -53,7 +53,7 @@ namespace Discord | |||||
| get => _embed.Thumbnail?.Url; | get => _embed.Thumbnail?.Url; | ||||
| set | set | ||||
| { | { | ||||
| if (!Uri.IsWellFormedUriString(value, UriKind.Absolute)) throw new ArgumentException("Url must be a well-formed URI", nameof(ThumbnailUrl)); | |||||
| if (!string.IsNullOrEmpty(value) && !Uri.IsWellFormedUriString(value, UriKind.Absolute)) throw new ArgumentException("Url must be a well-formed URI", nameof(ThumbnailUrl)); | |||||
| _embed.Thumbnail = new EmbedThumbnail(value, null, null, null); | _embed.Thumbnail = new EmbedThumbnail(value, null, null, null); | ||||
| } | } | ||||
| } | } | ||||
| @@ -62,7 +62,7 @@ namespace Discord | |||||
| get => _embed.Image?.Url; | get => _embed.Image?.Url; | ||||
| set | set | ||||
| { | { | ||||
| if (!Uri.IsWellFormedUriString(value, UriKind.Absolute)) throw new ArgumentException("Url must be a well-formed URI", nameof(ImageUrl)); | |||||
| if (!string.IsNullOrEmpty(value) && !Uri.IsWellFormedUriString(value, UriKind.Absolute)) throw new ArgumentException("Url must be a well-formed URI", nameof(ImageUrl)); | |||||
| _embed.Image = new EmbedImage(value, null, null, null); | _embed.Image = new EmbedImage(value, null, null, null); | ||||
| } | } | ||||
| } | } | ||||
| @@ -313,7 +313,7 @@ namespace Discord | |||||
| get => _author.Url; | get => _author.Url; | ||||
| set | set | ||||
| { | { | ||||
| if (!Uri.IsWellFormedUriString(value, UriKind.Absolute)) throw new ArgumentException("Url must be a well-formed URI", nameof(Url)); | |||||
| if (!string.IsNullOrEmpty(value) && !Uri.IsWellFormedUriString(value, UriKind.Absolute)) throw new ArgumentException("Url must be a well-formed URI", nameof(Url)); | |||||
| _author.Url = value; | _author.Url = value; | ||||
| } | } | ||||
| } | } | ||||
| @@ -322,7 +322,7 @@ namespace Discord | |||||
| get => _author.IconUrl; | get => _author.IconUrl; | ||||
| set | set | ||||
| { | { | ||||
| if (!Uri.IsWellFormedUriString(value, UriKind.Absolute)) throw new ArgumentException("Url must be a well-formed URI", nameof(IconUrl)); | |||||
| if (!string.IsNullOrEmpty(value) && !Uri.IsWellFormedUriString(value, UriKind.Absolute)) throw new ArgumentException("Url must be a well-formed URI", nameof(IconUrl)); | |||||
| _author.IconUrl = value; | _author.IconUrl = value; | ||||
| } | } | ||||
| } | } | ||||
| @@ -372,7 +372,7 @@ namespace Discord | |||||
| get => _footer.IconUrl; | get => _footer.IconUrl; | ||||
| set | set | ||||
| { | { | ||||
| if (value != null && !Uri.IsWellFormedUriString(value, UriKind.Absolute)) throw new ArgumentException("Url must be a well-formed URI", nameof(IconUrl)); | |||||
| if (!string.IsNullOrEmpty(value) && !Uri.IsWellFormedUriString(value, UriKind.Absolute)) throw new ArgumentException("Url must be a well-formed URI", nameof(IconUrl)); | |||||
| _footer.IconUrl = value; | _footer.IconUrl = value; | ||||
| } | } | ||||
| } | } | ||||