Fix AHelp erroring when sending empty avatar and footer icon urls (#13416)
This commit is contained in:
@@ -295,17 +295,17 @@ namespace Content.Server.Administration.Systems
|
|||||||
return new WebhookPayload
|
return new WebhookPayload
|
||||||
{
|
{
|
||||||
Username = username,
|
Username = username,
|
||||||
AvatarUrl = _avatarUrl,
|
AvatarUrl = string.IsNullOrWhiteSpace(_avatarUrl) ? null : _avatarUrl,
|
||||||
Embeds = new List<Embed>
|
Embeds = new List<Embed>
|
||||||
{
|
{
|
||||||
new Embed
|
new()
|
||||||
{
|
{
|
||||||
Description = messages,
|
Description = messages,
|
||||||
Color = color,
|
Color = color,
|
||||||
Footer = new EmbedFooter
|
Footer = new EmbedFooter
|
||||||
{
|
{
|
||||||
Text = $"{serverName} ({round})",
|
Text = $"{serverName} ({round})",
|
||||||
IconUrl = _footerIconUrl,
|
IconUrl = string.IsNullOrWhiteSpace(_footerIconUrl) ? null : _footerIconUrl
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -438,7 +438,7 @@ namespace Content.Server.Administration.Systems
|
|||||||
public string Username { get; set; } = "";
|
public string Username { get; set; } = "";
|
||||||
|
|
||||||
[JsonPropertyName("avatar_url")]
|
[JsonPropertyName("avatar_url")]
|
||||||
public string AvatarUrl { get; set; } = "";
|
public string? AvatarUrl { get; set; } = "";
|
||||||
|
|
||||||
[JsonPropertyName("embeds")]
|
[JsonPropertyName("embeds")]
|
||||||
public List<Embed>? Embeds { get; set; } = null;
|
public List<Embed>? Embeds { get; set; } = null;
|
||||||
@@ -479,7 +479,7 @@ namespace Content.Server.Administration.Systems
|
|||||||
public string Text { get; set; } = "";
|
public string Text { get; set; } = "";
|
||||||
|
|
||||||
[JsonPropertyName("icon_url")]
|
[JsonPropertyName("icon_url")]
|
||||||
public string IconUrl { get; set; } = "";
|
public string? IconUrl { get; set; }
|
||||||
|
|
||||||
public EmbedFooter()
|
public EmbedFooter()
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user