Fix lock_room_position error when forgetting room

This commit is contained in:
miruka 2021-04-13 15:24:57 -04:00
parent 96a1e57f47
commit 7db0e07281

View File

@ -2033,7 +2033,10 @@ class MatrixClient(nio.AsyncClient):
async def lock_room_position(self, room_id: str, lock: bool) -> None: async def lock_room_position(self, room_id: str, lock: bool) -> None:
"""Set wheter a room should try to hold its current sort position.""" """Set wheter a room should try to hold its current sort position."""
room = self.models[self.user_id, "rooms"][room_id] room = self.models[self.user_id, "rooms"].get(room_id)
if not room:
return
if not lock: if not lock:
room._sort_overrides = {} room._sort_overrides = {}