From 6b64ce81b2584dd1d454ddda623001dd54c2205d Mon Sep 17 00:00:00 2001 From: Rory& Date: Fri, 6 Jun 2025 20:20:35 +0200 Subject: Synapse admin fixes, variou schanges --- MatrixUtils.Web/Pages/Rooms/PolicyList.razor | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'MatrixUtils.Web/Pages/Rooms') diff --git a/MatrixUtils.Web/Pages/Rooms/PolicyList.razor b/MatrixUtils.Web/Pages/Rooms/PolicyList.razor index 5f70187..96879b8 100644 --- a/MatrixUtils.Web/Pages/Rooms/PolicyList.razor +++ b/MatrixUtils.Web/Pages/Rooms/PolicyList.razor @@ -100,11 +100,11 @@ else { @foreach (var policy in policies.OrderBy(x => x.RawContent?["entity"]?.GetValue())) { @{ - var typedContent = policy.TypedContent!; + var typedContent = policy.TypedContent! as PolicyRuleEventContent; } @foreach (var prop in proxySafeProps ?? Enumerable.Empty()) { if (prop.Name == "Entity") { - @TruncateMxid((string)prop.GetGetMethod()?.Invoke(typedContent, null)!) + @TruncateMxid(typedContent!.Entity) } else { @prop.GetGetMethod()?.Invoke(typedContent, null) @@ -339,7 +339,8 @@ else { private static Dictionary PolicyTypeIds = KnownPolicyTypes .ToDictionary(x => x, x => x.GetCustomAttributes().Select(y => y.EventName).ToArray()); - private static string TruncateMxid(string mxid) { + private static string TruncateMxid(string? mxid) { + if (string.IsNullOrWhiteSpace(mxid)) return mxid; var parts = mxid.Split(':', 2); if (parts[0].Length > 50) parts[0] = parts[0][..50] + "[...]"; -- cgit 1.5.1