Skip to content

Commit

Permalink
Fix role color lookup when role is removed but still owns a tag
Browse files Browse the repository at this point in the history
  • Loading branch information
calledude authored Jul 31, 2024
1 parent 37d1842 commit 34d4968
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Modix.Web/Pages/Tags.razor
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,9 @@
<MudTd style="white-space:nowrap" DataLabel="Last Modified">@tag.Created.ToString("MM/dd/yy, h:mm:ss tt")</MudTd>
@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";
<MudTd DataLabel="Owner" Style="@($"color: {roleColor}")">@@@tag.OwnerName</MudTd>
}
else
Expand Down

0 comments on commit 34d4968

Please sign in to comment.