Skip to content

Commit

Permalink
Include explicit check for strings
Browse files Browse the repository at this point in the history
  • Loading branch information
erikjohnston committed Jan 8, 2024
1 parent 056490e commit 6347a4d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions synapse/types/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -591,6 +591,9 @@ def __contains__(self, key: Any) -> bool:

typ, state_key = key

if not isinstance(typ, str) or not isinstance(state_key, str):
return False

if typ in self.types:
state_keys = self.types[typ]
if state_keys is None or state_key in state_keys:
Expand Down

0 comments on commit 6347a4d

Please sign in to comment.