mirror of
https://github.com/matrix-org/matrix-rust-sdk.git
synced 2026-05-02 21:18:15 -04:00
async_client: Don't assume that there are any state events.
This commit is contained in:
@@ -400,7 +400,7 @@ impl AsyncClient {
|
||||
}
|
||||
}
|
||||
|
||||
client.joined_rooms.get(&room_id).unwrap().clone()
|
||||
client.get_or_create_room(&room_id).clone()
|
||||
};
|
||||
|
||||
for event in &room.timeline.events {
|
||||
|
||||
@@ -250,7 +250,7 @@ impl Client {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn get_or_create_room(&mut self, room_id: &str) -> &mut Arc<RwLock<Room>> {
|
||||
pub(crate) fn get_or_create_room(&mut self, room_id: &str) -> &mut Arc<RwLock<Room>> {
|
||||
#[allow(clippy::or_fun_call)]
|
||||
self.joined_rooms
|
||||
.entry(room_id.to_string())
|
||||
|
||||
Reference in New Issue
Block a user