async_client: Don't assume that there are any state events.

This commit is contained in:
Damir Jelić 2020-03-14 18:47:56 +01:00
parent 39dd9280cb
commit 70dda32949
2 changed files with 2 additions and 2 deletions

View file

@ -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 {

View file

@ -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())