default to Undefined if room avatar URL was not found despite checking if its Some
Signed-off-by: strawberry <strawberry@puppygock.gay>
This commit is contained in:
parent
bb1edc3f1a
commit
0ea8657070
1 changed files with 3 additions and 1 deletions
|
@ -1640,7 +1640,9 @@ pub async fn sync_events_v4_route(
|
|||
ruma::JsOption::Some(heroes_avatar)
|
||||
} else {
|
||||
match services().rooms.state_accessor.get_avatar(room_id)? {
|
||||
ruma::JsOption::Some(avatar) => ruma::JsOption::Some(avatar.url.unwrap()),
|
||||
ruma::JsOption::Some(avatar) => avatar
|
||||
.url
|
||||
.map_or(ruma::JsOption::Undefined, ruma::JsOption::Some),
|
||||
ruma::JsOption::Null => ruma::JsOption::Null,
|
||||
ruma::JsOption::Undefined => ruma::JsOption::Undefined,
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue