diff options
author | Rory& <root@rory.gay> | 2024-05-03 17:12:35 +0200 |
---|---|---|
committer | Rory& <root@rory.gay> | 2024-05-03 17:12:35 +0200 |
commit | 896ee7f099f817e8cc9aba96a9db00fcce671632 (patch) | |
tree | 5c4c97baab8afb1b66ee4ffcced7285ab2ee06a0 /Tests/LibMatrix.HomeserverEmulator/Controllers/Rooms | |
parent | HomeserverEmulator work (diff) | |
download | LibMatrix-896ee7f099f817e8cc9aba96a9db00fcce671632.tar.xz |
Fix some race conditions and some optimisation in HomeserverEmulator
Diffstat (limited to 'Tests/LibMatrix.HomeserverEmulator/Controllers/Rooms')
-rw-r--r-- | Tests/LibMatrix.HomeserverEmulator/Controllers/Rooms/RoomStateController.cs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Tests/LibMatrix.HomeserverEmulator/Controllers/Rooms/RoomStateController.cs b/Tests/LibMatrix.HomeserverEmulator/Controllers/Rooms/RoomStateController.cs index a1738c9..74c70a3 100644 --- a/Tests/LibMatrix.HomeserverEmulator/Controllers/Rooms/RoomStateController.cs +++ b/Tests/LibMatrix.HomeserverEmulator/Controllers/Rooms/RoomStateController.cs @@ -64,11 +64,14 @@ public class RoomStateController(ILogger<RoomStateController> logger, TokenServi }; var stateEvent = room.State.FirstOrDefault(x => x.Type == eventType && x.StateKey == stateKey); - if (stateEvent == null) + if (stateEvent == null) { + Console.WriteLine($"Event not found in room {roomId} matching {eventType}/{stateKey}"); throw new MatrixException() { ErrorCode = "M_NOT_FOUND", Error = "Event not found" }; + } + // return stateEvent; return format == "event" ? stateEvent : stateEvent.RawContent; } |