about summary refs log tree commit diff
path: root/LibMatrix/Helpers/SyncHelper.cs
diff options
context:
space:
mode:
authorTheArcaneBrony <myrainbowdash949@gmail.com>2023-09-04 06:29:00 +0200
committerTheArcaneBrony <myrainbowdash949@gmail.com>2023-09-04 06:29:00 +0200
commit9dcce18cda5317ea1150eed06d6589b6285577e6 (patch)
tree1b36a9ddffa312e58daab075c43fb482c2bae905 /LibMatrix/Helpers/SyncHelper.cs
parentToo many changes to name... (diff)
downloadLibMatrix-9dcce18cda5317ea1150eed06d6589b6285577e6.tar.xz
Add start of Media Moderator PoC bot
Diffstat (limited to '')
-rw-r--r--LibMatrix/Helpers/SyncHelper.cs3
1 files changed, 2 insertions, 1 deletions
diff --git a/LibMatrix/Helpers/SyncHelper.cs b/LibMatrix/Helpers/SyncHelper.cs
index de4f3d4..83b1685 100644
--- a/LibMatrix/Helpers/SyncHelper.cs
+++ b/LibMatrix/Helpers/SyncHelper.cs
@@ -113,6 +113,7 @@ public class SyncHelper {
 
             if (sync.Rooms is { Join.Count: > 0 }) {
                 foreach (var updatedRoom in sync.Rooms.Join) {
+                    if(updatedRoom.Value.Timeline is null) continue;
                     foreach (var stateEventResponse in updatedRoom.Value.Timeline.Events) {
                         stateEventResponse.RoomId = updatedRoom.Key;
                         var tasks = TimelineEventHandlers.Select(x => x(stateEventResponse)).ToList();
@@ -178,7 +179,7 @@ public class SyncResult {
 
         public class JoinedRoomDataStructure {
             [JsonPropertyName("timeline")]
-            public TimelineDataStructure Timeline { get; set; }
+            public TimelineDataStructure? Timeline { get; set; }
 
             [JsonPropertyName("state")]
             public EventList State { get; set; }