From f5afd6aad464d5f3e9661493fbcdc8e710e2fe19 Mon Sep 17 00:00:00 2001 From: Plenyx <1507236+Plenyx@users.noreply.github.com> Date: Wed, 14 Feb 2024 23:44:03 +0100 Subject: [PATCH] Fixed an error with successful logs and Webhooks --- Forms/FormDiscordWebhooks.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Forms/FormDiscordWebhooks.cs b/Forms/FormDiscordWebhooks.cs index 5640683..a9e9170 100644 --- a/Forms/FormDiscordWebhooks.cs +++ b/Forms/FormDiscordWebhooks.cs @@ -294,8 +294,8 @@ internal async Task ExecuteAllActiveWebhooksAsync(DpsReportJson reportJSON, List { var bossName = $"{reportJSON.Encounter.Boss}{(reportJSON.ChallengeMode ? " CM" : "")}"; var successString = (reportJSON.Encounter.Success ?? false) ? ":white_check_mark:" : "❌"; - var lastTarget = reportJSON?.ExtraJson?.PossiblyLastTarget; - var extraJSON = (reportJSON.ExtraJson is null) ? "" : $"Recorded by: {reportJSON.ExtraJson.RecordedBy}\nDuration: {reportJSON.ExtraJson.Duration}\n{lastTarget.Name} ({Math.Round(100 - lastTarget.HealthPercentBurned, 2)}%)\nElite Insights version: {reportJSON.ExtraJson.EliteInsightsVersion}\n"; + var lastTarget = (reportJSON?.ExtraJson?.PossiblyLastTarget is not null) ? $"\n{reportJSON.ExtraJson.PossiblyLastTarget.Name} ({Math.Round(100 - reportJSON.ExtraJson.PossiblyLastTarget.HealthPercentBurned, 2)}%)" : ""; + var extraJSON = (reportJSON.ExtraJson is null) ? "" : $"Recorded by: {reportJSON.ExtraJson.RecordedBy}\nDuration: {reportJSON.ExtraJson.Duration}{lastTarget}\nElite Insights version: {reportJSON.ExtraJson.EliteInsightsVersion}\n"; var icon = ""; var bossData = Bosses.GetBossDataFromId(reportJSON.Encounter.BossId); if (bossData is not null)