From 6347a4deadf740efc2cebe4a93a7fd5e4c58081c Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Mon, 8 Jan 2024 15:31:24 +0000 Subject: [PATCH] Include explicit check for strings --- synapse/types/state.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/synapse/types/state.py b/synapse/types/state.py index 937ffe3f979..3c61cea992e 100644 --- a/synapse/types/state.py +++ b/synapse/types/state.py @@ -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: