about summary refs log tree commit diff
path: root/MatrixRoomUtils.Web/Pages/PolicyListRoomList.razor
diff options
context:
space:
mode:
authorTheArcaneBrony <myrainbowdash949@gmail.com>2023-05-04 00:40:55 +0200
committerTheArcaneBrony <myrainbowdash949@gmail.com>2023-05-04 00:40:55 +0200
commit5132155714d3953a4a4fb0eba7fe2febe7e5e564 (patch)
tree4383337796a79a391be27235692c0efb8fca23e4 /MatrixRoomUtils.Web/Pages/PolicyListRoomList.razor
parentFix state reloading (diff)
downloadMatrixUtils-5132155714d3953a4a4fb0eba7fe2febe7e5e564.tar.xz
Fix bugs in policy editor and state viewer
Diffstat (limited to 'MatrixRoomUtils.Web/Pages/PolicyListRoomList.razor')
-rw-r--r--MatrixRoomUtils.Web/Pages/PolicyListRoomList.razor4
1 files changed, 3 insertions, 1 deletions
diff --git a/MatrixRoomUtils.Web/Pages/PolicyListRoomList.razor b/MatrixRoomUtils.Web/Pages/PolicyListRoomList.razor
index 924b68f..3af60b7 100644
--- a/MatrixRoomUtils.Web/Pages/PolicyListRoomList.razor
+++ b/MatrixRoomUtils.Web/Pages/PolicyListRoomList.razor
@@ -125,7 +125,9 @@ else
 
     // --- //
             var r = await RuntimeCache.CurrentHomeServer.GetRoom(room);
-            roomInfo.Shortcode = (await r.GetStateAsync("org.matrix.mjolnir.shortcode")).Value.GetProperty("shortcode").GetString();
+            var shortcodeState = await r.GetStateAsync("org.matrix.mjolnir.shortcode");
+            if(!shortcodeState.HasValue) return null;
+            roomInfo.Shortcode = shortcodeState.Value.TryGetProperty("shortcode", out JsonElement shortcode) ? shortcode.GetString() : null;
 
             if (roomInfo.Shortcode != null)
             {