about summary refs log tree commit diff
path: root/MatrixUtils.Web/Pages/Rooms
diff options
context:
space:
mode:
authorRory& <root@rory.gay>2025-06-06 20:20:35 +0200
committerRory& <root@rory.gay>2025-06-06 20:21:20 +0200
commit6b64ce81b2584dd1d454ddda623001dd54c2205d (patch)
treeccdfd72e7f2f58a19f4206e032e8fe31dd506073 /MatrixUtils.Web/Pages/Rooms
parentFix room list (diff)
downloadMatrixUtils-dev/synapse-resync-state.tar.xz
Synapse admin fixes, variou schanges dev/synapse-resync-state
Diffstat (limited to 'MatrixUtils.Web/Pages/Rooms')
-rw-r--r--MatrixUtils.Web/Pages/Rooms/PolicyList.razor7
1 files changed, 4 insertions, 3 deletions
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<string>())) { <tr> @{ - var typedContent = policy.TypedContent!; + var typedContent = policy.TypedContent! as PolicyRuleEventContent; } @foreach (var prop in proxySafeProps ?? Enumerable.Empty<PropertyInfo>()) { if (prop.Name == "Entity") { - <td>@TruncateMxid((string)prop.GetGetMethod()?.Invoke(typedContent, null)!)</td> + <td>@TruncateMxid(typedContent!.Entity)</td> } else { <td>@prop.GetGetMethod()?.Invoke(typedContent, null)</td> @@ -339,7 +339,8 @@ else { private static Dictionary<Type, string[]> PolicyTypeIds = KnownPolicyTypes .ToDictionary(x => x, x => x.GetCustomAttributes<MatrixEventAttribute>().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] + "[...]";