dont crash failing to deserialise room creation content
Signed-off-by: strawberry <strawberry@puppygock.gay>
This commit is contained in:
parent
3453dcc344
commit
ead9a58dce
1 changed files with 4 additions and 1 deletions
|
@ -149,7 +149,10 @@ pub async fn create_room_route(
|
|||
Some(content) => {
|
||||
let mut content = content
|
||||
.deserialize_as::<CanonicalJsonObject>()
|
||||
.expect("Invalid creation content");
|
||||
.map_err(|e| {
|
||||
error!("Failed to deserialise content as canonical JSON: {}", e);
|
||||
Error::bad_database("Failed to deserialise content as canonical JSON.")
|
||||
})?;
|
||||
match room_version {
|
||||
RoomVersionId::V1
|
||||
| RoomVersionId::V2
|
||||
|
|
Loading…
Add table
Reference in a new issue