From 34d4968cbdf24c7556cf8b4c25f13181f5556f84 Mon Sep 17 00:00:00 2001 From: Calle <22471295+calledude@users.noreply.github.com> Date: Wed, 31 Jul 2024 12:26:14 +0200 Subject: [PATCH 1/2] Fix role color lookup when role is removed but still owns a tag --- src/Modix.Web/Pages/Tags.razor | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Modix.Web/Pages/Tags.razor b/src/Modix.Web/Pages/Tags.razor index 561109454..71f546c8a 100644 --- a/src/Modix.Web/Pages/Tags.razor +++ b/src/Modix.Web/Pages/Tags.razor @@ -64,7 +64,9 @@ @tag.Created.ToString("MM/dd/yy, h:mm:ss tt") @if (tag.OwnerRole is not null) { - var roleColor = Roles[tag.OwnerRole.Id].Color; + + _ = Roles.TryGetValue(tag.OwnerRole.Id, out var role); + var roleColor = role?.Color ?? "currentColor"; @@@tag.OwnerName } else From 138cb8571908b154a982860f67340527f81cf0fa Mon Sep 17 00:00:00 2001 From: Calle <22471295+calledude@users.noreply.github.com> Date: Wed, 31 Jul 2024 12:27:10 +0200 Subject: [PATCH 2/2] whitespace --- src/Modix.Web/Pages/Tags.razor | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Modix.Web/Pages/Tags.razor b/src/Modix.Web/Pages/Tags.razor index 71f546c8a..5bfe39af0 100644 --- a/src/Modix.Web/Pages/Tags.razor +++ b/src/Modix.Web/Pages/Tags.razor @@ -64,7 +64,6 @@ @tag.Created.ToString("MM/dd/yy, h:mm:ss tt") @if (tag.OwnerRole is not null) { - _ = Roles.TryGetValue(tag.OwnerRole.Id, out var role); var roleColor = role?.Color ?? "currentColor"; @@@tag.OwnerName