From b0c39f38463cb5b1bd6474eb07a976d7cea446fa Mon Sep 17 00:00:00 2001 From: Charlie Calendre <57274151+c-cal@users.noreply.github.com> Date: Fri, 8 Mar 2024 13:55:47 +0100 Subject: [PATCH] Check if `data["content"]` is a dict before using it as a dict --- sygnal/gcmpushkin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sygnal/gcmpushkin.py b/sygnal/gcmpushkin.py index 1177c0aa..621c2fd7 100644 --- a/sygnal/gcmpushkin.py +++ b/sygnal/gcmpushkin.py @@ -669,7 +669,7 @@ def _build_data( data[attr] = data[attr][0:MAX_BYTES_PER_FIELD] if api_version is APIVersion.V1: - if "content" in data: + if isinstance(data.get("content"), dict): for attr, value in data["content"].items(): if not isinstance(value, str): continue