diff options
Diffstat (limited to 'MatrixRoomUtils.Web/Pages/PolicyListRoomList.razor')
-rw-r--r-- | MatrixRoomUtils.Web/Pages/PolicyListRoomList.razor | 4 |
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) { |