From 427e586f8032490f5a3277ee92f881fe8b002c6a Mon Sep 17 00:00:00 2001 From: DrSmugleaf Date: Tue, 10 Jan 2023 17:33:38 +0100 Subject: [PATCH] Fix AHelp erroring when sending empty avatar and footer icon urls (#13416) --- Content.Server/Administration/Systems/BwoinkSystem.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Content.Server/Administration/Systems/BwoinkSystem.cs b/Content.Server/Administration/Systems/BwoinkSystem.cs index fdb9d369dc..0d42407b15 100644 --- a/Content.Server/Administration/Systems/BwoinkSystem.cs +++ b/Content.Server/Administration/Systems/BwoinkSystem.cs @@ -295,17 +295,17 @@ namespace Content.Server.Administration.Systems return new WebhookPayload { Username = username, - AvatarUrl = _avatarUrl, + AvatarUrl = string.IsNullOrWhiteSpace(_avatarUrl) ? null : _avatarUrl, Embeds = new List { - new Embed + new() { Description = messages, Color = color, Footer = new EmbedFooter { 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; } = ""; [JsonPropertyName("avatar_url")] - public string AvatarUrl { get; set; } = ""; + public string? AvatarUrl { get; set; } = ""; [JsonPropertyName("embeds")] public List? Embeds { get; set; } = null; @@ -479,7 +479,7 @@ namespace Content.Server.Administration.Systems public string Text { get; set; } = ""; [JsonPropertyName("icon_url")] - public string IconUrl { get; set; } = ""; + public string? IconUrl { get; set; } public EmbedFooter() {